# graphics - )text(0.1,0.80'y_2 = sin(x)xlabel'x)ylabel'y_1...

This preview shows page 1. Sign up to view the full content.

% Appendix A: MATLAB Basics, Section A.4%% MATLAB graphics described in Section A.4 % includes Figures A.18 - A.20. 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.%clearformathold offclg% -------------- Figure A.18x=[0:0.1:1]';y=x.*sin(x);plot(x,y)title('Figure A.18: Plot of x sin(x) vs x')xlabel('x')ylabel('y')grid onpause%% -------------- Figure A.19x=[0:0.1:1]'; y1=x.*sin(x); y2=sin(x);plot(x,y1,'--',x,y2,'-.')text(0.1,0.85,'y_1 = x sin(x) - -
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: -')text(0.1,0.80,'y_2 = sin(x) ._._')xlabel('x')ylabel('y_1 and y_2')title('Figure A.19')gridpause %% -------------- Figure A.20dx=[0:0.1:1]';y1=x.*sin(x); y2=sin(x); subplot(2,2,1),plot(x,y1,'--',x,y2,'-.')title('Figure A.20a: subplot(2,2,1)') subplot(2,2,2),plot(x,y1,'--',x,y2,'-.')title('Figure A.20b: subplot(2,2,2)') subplot(2,2,3),plot(x,y1,'--',x,y2,'-.')title('Figure A.20c: subplot(2,2,3)') subplot(2,2,4),plot(x,y1,'--',x,y2,'-.')title('Figure A.20d: subplot(2,2,4)')...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online