659
edits
Carandraug (talk | contribs) m (→Default arguments: use octave syntax highlight) |
Carandraug (talk | contribs) 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=" | {{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); |