Command syntax for matlab function still generates output? -
there two ways call functions in matlab, command syntax , function syntax. viewing code written else in there's statement follows in 1 .m file:
params=sys_params; while sys_params defined function in .m file as:
function params=sys_params() params happens structure. wish know is, if according matlab documentation, command syntax cannot used output function, how first statement working well?
two things:
- the distinction between command , function syntax comes play when arguments passed.
the parentheses calling function in matlab optional when calling no arguments. matlab call function without invoking
()unlike other languages.one exception comes mind
()required invoke function handle/anonymous function.
from calling functions:
to call function not require inputs , not return outputs, type function name
the 1 ambiguous thing not explicitly told there assigning output of such function call valid.
i'll note don't () optional hides function calls at-first-glance. therefore, try use () possible make clear invoking function, of scripts start clc();clear();.
Comments
Post a Comment