Lecture_03_Functions_p6 - Lecture 3: Functions 1. 2. 3. 4....

Info iconThis preview shows pages 1–2. 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. 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. This line of code is what
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/07/2011 for the course ENGIN 7 taught by Professor Horowitz during the Spring '08 term at University of California, Berkeley.

Page1 / 3

Lecture_03_Functions_p6 - Lecture 3: Functions 1. 2. 3. 4....

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online