>> 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.