swap.m 150 B

123456789
  1. function [y,x] = swap(x,y)
  2. % function [x,y] = swap(x,y)
  3. %
  4. % assign <x> to <y> and assign <y> to <x>.
  5. %
  6. % example:
  7. % [x,y] = swap(2,3);
  8. % x==3 & y==2