📄 graphics.m
字号:
% Appendix F: MATLAB Basics, Section F.4, p. 827-830.%% MATLAB graphics described in Section F.4 % includes Figures F.18 - F.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 F.18x=[0:0.1:1]';y=x.*sin(x);plot(x,y)title('Figure F.18: Plot of x sin(x) vs x')xlabel('x')ylabel('y')gridpause%% -------------- Figure F.19x=[0:0.1:1]';y1=x.*sin(x); y2=sin(x);plot(x,y1,'--',x,y2,'-.')text(0.1,0.85,'y1 = x sin(x) - - -')text(0.1,0.80,'y2 = sin(x) ._._')xlabel('x')ylabel('y1 and y2')title('Figure F.19')gridpause %% -------------- Figure F.20dx=[0:0.1:1]';y1=x.*sin(x); y2=sin(x);subplot(221),plot(x,y1,'--',x,y2,'-.')title('Figure F.20a: subplot(221)')subplot(222),plot(x,y1,'--',x,y2,'-.')title('Figure F.20b: subplot(222)')subplot(223),plot(x,y1,'--',x,y2,'-.')title('Figure F.20c: subplot(223)')subplot(224),plot(x,y1,'--',x,y2,'-.')title('Figure F.20d: subplot(224)')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -