MAE 08 Lecture 17: Chapter 6

53 views3 pages

Document Summary

User defined functions: multiple inputs multiple outputs. Inputs no outputs: no inputs outputs, no inputs no outputs, passing arguments between scripts/functions. Matlab program organization: primary functions/ subfunctions, variable scope: local, persistent, global, modular programs. Multiple functions can be put in the same file. The first function is the primary function. Other functions are subfunctions which are called by the primary function. Name of the primary function must match with the name of the m-file. Subfunctions are only known to primary function. Subfunctions can not be called form the command window. Scope of any variable is the workspace in which it is valid. The workspace created in the command window is called the base workspace. When a variable is created in a function, it is a local variable to that function (function workspace) Local variables only exist while the functions is executing, they cease to exist when the function stops executing.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents