% data for Exercise Set 7.8

ex = input('Exercise number (1,3,4)? ');

if ex==1
   X = [1 -2;1 -1;1 0;1 1;1 2], y = [0;0;2;4;4] 
elseif ex==3 
   disp('The following vectors of values are COLUMN vectors, but are displayed in rows.')
   p0 = [1 1 1 1 1], p1 = [-2 -1 0 1 2], p2 = [2 -1 -2 -1 2]
   p3 = [-1 2 0 -2 1], y = [3 5 5 4 3]
   p0=p0';p1=p1';p2=p2';p3=p3';y=y';
elseif ex==4 
   disp('The following vectors of values are COLUMN vectors, but are displayed in rows.')
   p0 = [1 1 1 1 1 1], p1 = [-5 -3 -1 1 3 5], p2 = [5 -1 -4 -4 -1 5], y = [1 1 4 4 6 8] 
   p0=p0';p1=p1';p2=p2';y=y';
   disp('Make sure you understand how p2 was found.') 
else
   disp('No data for this exercise in Section 7.8.')
end
