正在加载图片...
数学实验与 Matlab ◆观察指令 legend和mum2s的用 Peroid and linear peroid function 法:在同张图上画出y=sn()和y=3e0, The linear period functiong(x 这里t∈[O,3],并进行适当的标主 zxy2_2.m If t=0:0.1:3*pi; alpha=0:0.1:3*pi 101520253 plot(t, sin(t), 'r-); hold or 图2.5文字标注 plot(alpha, 3*exp(-05*alpha), ' k: ' set(gca, 'fontsize, 15, ' fontname, ' times New Roman) xlabel (\it(t(deg),'); ylabel('\it(magnitude); title('lit(sine wave and f\it(Ae))t-alphaflitt wave); %i &r \alphal 意义 text(6, sin(6), \fontsize(15) The Value \(sin(t))at fitt =6\rightarrowlbullet', 'HorizontalAlignment', 'right,) %上面的语句是一整行,如果要写成两行,必须使用续行号…,例如要在 bullet %后换行,需写“ bullet',…”后才能换行。 %' Horizontalalignment';righ!'表示箭头所指的曲线对象在文字的右边。 text(2, 3*exp(-0 5*2), '\fontsize 15)\bullet\leftarrow The Value of ); %num2str的用法:[' string',num2str,' string2],注意方括号的使用 % legend(" Itsin(t)';{ \itAe}^{- \alphat}")%请结合图形观察此命令的使 运行结果如图26所示 5.图形窗口的创建和分割 观察 clf, b=2+pi; x=linspace(0, b, 50)数学实验与 Matlab 9 9 ◆ 观察指令 legend 和 num2str 的用 法:在同一张图上画出 t y t y e 0.5 sin( ) 3 − = 和 = , 这里 t [0,3], 并进行适当的标注。 zxy2_2.m 【 clf, t=0:0.1:3* pi;alpha=0:0.1:3* pi; plot(t,sin(t),'r-');hold on; plot(alpha,3* exp(-0.5* alpha),'k:'); set(gca,'fontsize',15,'fontname','times New Roman'), xlabel('\it{t(deg)}');ylabel('\it{magnitude}'); title(' \it{sine wave and { \it{Ae}}^{-\alpha{\itt}}wave}'); %注 意\alpha的 意 义 text(6,sin(6),'\fontsize{15}The Value \it{sin(t)} at {\itt}=6\rightarrow\bullet', 'HorizontalAlignment','right'), %上面的语句是一整行,如果要写成两行,必须使用续行号 … ,例如要在 “ bullet',” %后换行,需写“bullet', …”后才能换行。 % 'HorizontalAlignment','right' 表示箭头所指的曲线对象在 文字的右边。 text(2,3* exp(-0.5* 2),['\fontsize{15}\bullet\leftarrow The Value of \it{3e}^{-0.5 \it{t}}=',num2str(3* exp(-0.5* 2)),' at \it{t} =2 ']); %num2str的用法:['string1' ,num2str,'string2'],注意方括号的使用。 %legend('\itsin(t)','{\itAe}^{-\alphat}') % 请结合图形观察此命令的使 用 】 运行结果如图2.6所示。 5. 图形窗口的创建和分割 ◆ 观察: 【 clf,b=2* pi;x=linspace(0,b,50); 0 5 10 15 20 25 30 -1 0 1 2 3 4 5 6 Peroid and linear peroid function x y ?? The period function f(x) The linear period function g(x)? ? 图 2.5 文字标注
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有