MATLAB Lecture 8 School of Mathematical Sciences Xiamen Univer tp: /gdjpkc. xmu. edu.cn >>y2=c0s(x) plot(x, yl, b-',x, y2, k--) >legend (sin x',cosx) =4线:口口 Create Multiple Figures >figure(1) %figure window 1 >x=00.05:2 > plot(x, yD) > figure(2) %create another figure window plot(x, y2); 小 Figute2 tile Eat fie Insert Tools lesktog LiadesHelp Eile Rtt ye sert Tools Desktop Yindo yule 日舀回←日■ 舀代费回长日目日回 0204 subplot(2, 1, 1) %create 2 X lsubplots in current figure, arranged in 2 rows and I column, and selects subplot I to receive all current plotting commandsMATLAB Lecture 8 School of Mathematical Sciences Xiamen University http://gdjpkc.xmu.edu.cn Lec88 >> y2 = cos(x); >> plot (x, y1, ‘b’, x, y2, ‘k’); >> legend (‘sin x’, ‘cosx’) ² Create Multiple Figures >> figure(1) %figure window 1 >> x = 0:0.05:2; >> y1 = exp(x) ; >> plot (x, y1); >> figure (2) %create another figure window 2 >> y2 = exp(x); >> plot (x, y2); ² Subplots >> subplot(2,1,1) %create 2×1subplots in current figure, arranged in 2 rows … and 1 column, and selects subplot 1 to receive all current … plotting commands >> x = pi:pi/20:pi;