User-defined Functions (11/28) Optional Arguments Optional arguments can be checked using: nargin:number of input arguments nargout:number of output arguments nargchk:validates number of arguments error:display error message and abort the function producing the error warning:display warning message and continue function execution inputname:return the actual name of the variable that corresponds to a particular argument number 同停大学 TONGJI UNIVERSITY Optional arguments can be checked using: ✓ nargin: number of input arguments ✓ nargout: number of output arguments ✓ nargchk: validates number of arguments ✓ error: display error message and abort the function producing the error ✓ warning: display warning message and continue function execution ✓ inputname: return the actual name of the variable that corresponds to a particular argument number User-defined Functions (11/28) Optional Arguments