Performance: Difference between revisions

No change in size ,  18 June 2012
m
use octave syntax highlight
m (→‎Default arguments: use octave syntax highlight)
m (use octave syntax highlight)
 
Line 35: Line 35:
When passing variables to a function, Octave will only make a copy of it is going to be modified. That is, unless the argument needs to be changed, the variable will be like a reference and take no extra memory or time to write.
When passing variables to a function, Octave will only make a copy of it is going to be modified. That is, unless the argument needs to be changed, the variable will be like a reference and take no extra memory or time to write.


{{Code|Looking at lazy copying|<syntaxhighlight lang="matlab" style="font-size:13px">
{{Code|Looking at lazy copying|<syntaxhighlight lang="octave" style="font-size:13px">
function read_arg (arg)
function read_arg (arg)
   x = arg(1);
   x = arg(1);