Variables in functions within local workspace, which is separated from base workspace
Performance is more like pass by value
A function file contains one primary function and several sub-functions, primary functions can be called from outside, sub-functions are visible only to the functions inside the function file that defines them
Private functions are saved in "private" folder; all private functions are only visible to the functions in the parent folder
function [a, b] = change(a, b)
nargin % number of input parameters
a = a+1;
b = b+1;
nargout % number of output parameters
end
function test()
a = 1; b = 10;
[c, d] = change(a, b);
a
b
c
d
end