{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


Lecture_03_Functions_p2 - Lecture 3 Functions 1 2 3 4 5 6...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 1. Creating your own functions 2. Structure of functions 3. Functions with several outputs 4. Subfunctions 5. Function handles 6. Scripts Lecture 3: Functions What are functions? In programming, a function is a sequence of instructions that perform a specific task. A function has input arguments which are made available to it by the user, the entity calling the function. Functions also has output arguments which are the results of the function that the user expects to receive once the function has completed its task.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 Structure of a function Specifies a function output variable: out Input variables: a, b, and c. Function name Declaration of the function (function header): Structure of a function None of that stuff is executed by this function, it is just there to help you and others understand what the function does Comments are good hygiene! Any line starting with a % is a comment. It will not be executed by the function.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}