资源描述
单击此处编辑母版标题样式,单击此处编辑母版文本样式,第二级,第三级,第四级,第五级,*,MATLAB学习点滴5,前进一步,1,显示多个图形,t = 0 : pi/20 : 2*pi;, x, y = meshgrid ( t );,subplot ( 2, 2, 1 ),plot ( sin ( t ), cos ( t ) ),axis equal,subplot ( 2, 2, 2 ),z = sin ( x ) + cos ( y );,plot ( t, z ),axis ( 0 2*pi -2 2 ),2,显示多个图形(Cont.),subplot ( 2, 2, 3 ),z = sin ( x ).*cos ( y );,plot ( t, z ),axis ( 0 2*pi -1 1 ),subplot ( 2, 2, 4 ),z = ( sin ( x ).2 ) ( cos ( y ).2);,plot ( t, z ),axis ( 0 2*pi -1 1 ),3,Output,4,计算标注文字的位置,t = 0 : 900;,hold on;,plot ( t, 0.25 * exp ( -0.005 * t ) );,text ( 300, .25 * exp ( -0.005 * 300 ), bullet leftarrow fontname times 0.25 ite -0.005 itt at t = 300 , FontSize , 14 ),hold off;,5,Output,6,更详细标注信息,x = linspace ( 0, 2 * pi, 60 );,a = sin ( x ); b = cos ( x );,hold on,stem_handles = stem ( x, a + b );,plot_handles = plot ( x, a, r, x, b, -g);,xlabel (Time in musecs ),7,更详细标注信息 (Cont.),ylabel (Magnitude ),title (Linear Combination of Two Functions ),legend_handles = stem_handles ; plot_handles ;,legend ( legend_handles, a + b, a = sin ( x ), b = cos ( x ) ),8,Output,9,更为复杂的标注说明,包括不同统计量,x = 0:.2:12;,plot(x,bessel(1,x),x,bessel(2,x),x,bessel(3,x);,legend(First,Second,Third);,legend(First,Second,Third,-1),10,更为复杂的标注说明,包括不同统计量,b = bar(rand(10,5),stacked); colormap(summer); hold on,x = plot(1:10,5*rand(10,1),marker,square,markersize,12,.,markeredgecolor,y,markerfacecolor,.6 0 .6,.,linestyle,-,color,r,linewidth,2); hold off,legend(b,x,Carrots,Peas,Peppers,Green Beans,.,Cucumbers,Eggplant) x = 0:.2:12;,plot(x,bessel(1,x),x,bessel(2,x),x,bessel(3,x);,legend(First,Second,Third);,legend(First,Second,Third,-1),11,更为复杂的标注说明,包括不同统计量,b = bar(rand(10,5),stacked); colormap(summer); hold on,x = plot(1:10,5*rand(10,1),marker,square,markersize,12,.,markeredgecolor,y,markerfacecolor,.6 0 .6,.,linestyle,-,color,r,linewidth,2); hold off,legend(b,x,Carrots,Peas,Peppers,Green Beans,.,Cucumbers,Eggplant),12,Output,13,
展开阅读全文