Argument Passing

All input arguments are passed by value. Therefore assigning values to the input arguments inside the function definition will not alter the original values of the arguments of the caller.
 
>>  f = function x -> y
               x = x^2 + 1;
               y = sqrt(x);
        end
>>  p = 25;
>>  f(p)
      25.01999201
>>  p
      25

If it is desired to change the value of a local variable using a function, one can either assign the result of the function call to the variable, or pass a pointer (See 8.2) to the function.



oz 2009-12-22