%------------------------------------------------------------------------------
% Different example. How do you swap values?  

  clear; clc;
  disp(['swapping values'])
  v1 = input('give me value1: ');
  v2 = input('give me value2: ');

  % swapping using a "temporary" variable
  % $tmp$ acts as a placeholder
    tmp = v1;  % store value of v1 to keep that value safe
    v1  = v2;  % v1 is reassigned!
    v2  = tmp; % phew! aren't you glad you stored the value of v1 somewhere?

    disp(['v1 now has v2 value: ' num2str(v1)])
    disp(['v2 now has v1 value: ' num2str(v2)])
%------------------------------------------------------------------------------
