ENGR 121 Lecture Notes - Lecture 10: Reserved Word, Matlab

49 views4 pages

Document Summary

Week 10: matlab programs: funcions that calculate and return one value, funcions that calculate and return more than one value, funcions that accomplish a task, such as prining, without returning any values. Generic funcion deiniion: funcion header reserved word funcion. Calling the funcion: since the funcion is returning muliple values through the output arguments, the funcion call should be in an assignment statement with muliple variables in a vector on the let hand side of the funcion header. Example funcion call: for example, if the funcion header is funcion [x,y,z] = fnname(a,b, this indicates that the funcion is returning three things, so the call to the funcion might be. [g,h,t] = fnname(11, 4. 3): or using the same names as the output arguments (both ways are valid) [x,y,z] = fnname(11, 4. 3): the following funcion call would only get the irst value returned result = fnname(11, 4. 3);

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