% Appendix A: MATLAB Basics, Section A.3
%
%    The MATLAB use of matrices described in Section A.3  
%    includes Figures A.12 - A.17.  After each subtopic, a 
%    pause is inserted to allow you to inspect the output.  Hit 
%    the space bar (or any other key) to continue to the next 
%    subtopic.
%
clear
format
% -------------- Figure A.12
disp(' -------------- Figure A.12')
A=[1,-4*j,sqrt(2);
log(-1) sin(pi/2) cos(pi/3)
asin(0.5),acos(0.8) exp(0.8)]
A=[1 2;4 5]
pause
%
% -------------- Figure A.13
disp(' -------------- Figure A.13')
A=[1 3;5 9]; B=[4 -7;10 0];
A+B
b=[1;5];
A*b
A'
pause 
%
% -------------- Figure A.14
disp(' -------------- Figure A.14')
x=[5;pi;sin(pi/2)];y=[exp(-0.5);-13;pi^2];
x'*y
x*y'
pause 
%
% -------------- Figure A.15
disp(' -------------- Figure A.15')
A=[1;2;3]; B=[-6;7;10];
A.*B
A.^2
pause 
%
% -------------- Figure A.17
disp(' -------------- Figure A.17')
x=[0:0.1:1]'; y=x.*sin(x);
[x,y]