Module 1, part 7. User-defined functions.
Contents
No. | Topic | Discussion |
---|---|---|
1. | User defined functions Blecture pdf | This blecture shows you how to define and call your own functions. |
2. | Subfunctions Read Chapman § 5.7.1 |
One m-file can contain multiple functions. This section shows you how to create subfunctions. |
3. | Examples dotsInCircles.m randDouble.m polar2xy.m drawColorDot.m |
This set of four functions produces some graphics. Download the files and experiment with them! The main function that calls the rest is
Look closely at the function headers and how they are called. This example includes functions with one output arguments, multiple output arguments, and no output arguments. Make sure that you know how to call functions given a function header. |
4. | Executing a function Blecture pdf | This blecture shows you how a function executes and what happens in memory space. |
5. | Self-check exercise | Practice defining your own functions and calling them from scripts or other functions |