Cookbook: Difference between revisions
Jump to navigation
Jump to search
Carandraug (talk | contribs) m (→Retrieve a field value from all entries in a struct array: fixing code, leftoverd from older example) |
|||
Line 32: | Line 32: | ||
== Input/output == | == Input/output == | ||
=== Swap values === | |||
If you want to exchange the value between two variables without creating a dummy one, you can simply do: | |||
{{Code|Swap values without dummy variable|<syntaxhighlight lang="octave" style="font-size:13px"> | |||
[b,a] = deal(a,b); | |||
</syntaxhighlight>}} | |||
== Mathematics == | == Mathematics == | ||
=== Find if a number is even/odd === | === Find if a number is even/odd === |