% data for Exercise Set 2.1

ex = input('Exercise number (15-20, 25-29)? ');

if ex==15 
   a1 = [1;0;1], a2 = [-2;1;-2], a3 = [-6;3;-5], b = [11;-5;9]
   disp('Given a vector equation xa1 + ya2 + za3 = b, where a1,a2,a3 and b are vectors,')
   disp('  the augmented matrix for the associated system of equations is formed by')
   disp('  the MATLAB command   M = [a1  a2  a3  b]   This places the column vectors')
   disp('  into a matrix  M  which is then available for study with MATLAB.')
elseif ex==16
   a1 = [1;0;-2],  a2 = [-4;3;8], a3 = [2;5;-4], b = [3;-7;-3]
   disp('Given a vector equation xa1 + ya2 + za3 = b, where a1,a2,a3 and b are vectors,')
   disp('  the augmented matrix for the associated system of equations is formed by')
   disp('  the MATLAB command   M = [a1  a2  a3  b]   This places the column vectors')
   disp('  into a matrix  M  which is then available for study with MATLAB.') 
elseif ex==17
   A = [1 2;2 7;-3 -9], b = [-1;-3;8] 
   disp('The two columns of A are A(:,1) and A(:,2).  Try typing them.  The')
   disp('  vector equation you need to solve is xA(:,1) + yA(:,2) = b.  So you')
   disp('  can use the three vectors to form an augmented matrix:')
   disp('             [A(:,1)  A(:,2)  b]')
   disp('  (Can you devise an easier way to construct this matrix?)') 
elseif ex==18 
   A = [1 0;-1 -2; 5 4], b = [1;2;-1] 
   disp('Try Exercise 17 first if you need help constructing the augmented matrix.') 
elseif ex==19
   A = [1 0 2;-2 1 0;2 1 8], b = [-5;11;-7] 
elseif ex==20
   A = [1 0 5;-2 1 -6;0 2 8], b = [2;-1;6] 
elseif ex==25
   A = [1 0 -4;0 1 -2;-2 3 3], b = [4;1;-4], a1 = [1;0;-2], a2 = [0;1;3],
   a3 = [-4;-2;3] 
elseif ex==26
   A = [2 0 6;-1 8 5;1 -2 1], b = [10;3;3], a1 = [2;-1;1], a2 = [0;8;-2],
   a3 = [6;5;1]  
elseif ex==27
   v1 = [20;550], v2 = [30;500], b = [150;2825], A = [20 30;550 500] 
elseif ex==28
   v1 = [27.6;3100;250], v2 = [30.2;6400;360] 
elseif ex==29
   v1 = [5;-4;3], v2 = [4;3;-2], v3 = [-4;-3;-1], v4 = [-9;8;6]  
else
   disp('No data for this exercise in Section 2.1.') 
end
