% HW1:  p. 20, #2(a,b,e,f,h,i), 3, 4.

% problem 2.

A = [10 -3; 4 2];  B = [1 0; -1 2];  v=[1;2];  w = [1;1];
vTw = v'*w
vwT = v*w'
AB = A*B
BA = B*A
y = B\w
x = A\v

% problem 3.

x = [0:.01:2*pi];
plot(x,sin(x),'r', x,sin(2*x),'b', x,sin(3*x),'g', x,sin(4*x),'y', x,sin(5*x),'c')
xlabel('x')
ylabel('sin(k*x)')
title(' k=1(red), 2(blue), 3(green), 4(yellow), 5(cyan)')

% problem 4.

fprintf('      x          sin(x)       cos(x)   \n'),
for x=0:pi/6:2*pi, fprintf('%12.6f %12.6f %12.6f\n', x,sin(x),cos(x)), end;
