matlab程序题复习分析和总结.pdfVIP

  • 16
  • 0
  • 约1.5万字
  • 约 9页
  • 2021-11-20 发布于上海
  • 举报
实用标准文案 t 1. 编写 m文件要求利用 matlab 数值绘图功能画出衰减振荡曲线 y e 3 t sin 3 及其它的包络线 t t y0 e 3 。t 的取值范围是 [ 0,4 ] ,数值采样间隔点为 pi/50 , y e 3 sin 3t 在图中用红色是 t 线段绘出, y0 e 3 用蓝色虚线绘出,且两函数作在同一张图上。 1. t=0:pi/50:4*pi; y0=exp(-t/3); y=exp(-t/3).*sin(3*t); figure; plot(t,y,-r) hold on; plot(t,y0,:b); plot(t,-y0,:b); hold off; title( ‘y=exp(-t/3)sin(3t) ’); xlabel( ‘x ’) ylabel( ‘y ’) 2 2 sin( x y ) 2. 利用 matlab 数值绘图功能, 画出 z 所表示的三维曲面。 x, y 的取值范围是 2 2 x y [ 8,8] ,要求去除当 x,y 均等于 0 时,函数 z 的不连续点,数值坐标采样间隔为 0.5. 2. clear;x=-8:0.5:8; y=x; [X Y ]=meshgrid(x,y); R=sqrt(X.^2+Y.^2)+eps; Z=sin(R)./R; surf(X,Y,Z); (mesh(X,Y,Z)) colormap(cool) xlabel(x),ylabel(y),zlabel(z) Title( ‘z=sin(sqrt(x^2+y^2)/sqrt(x^2+y^2)); 3. 利用 matlab 数值绘图功能,绘制 t 在区间[ -2pi 2pi ]时函数 y=sin(t)/t 的图形,采样间 隔为 pi/10 ,要求利用逻辑运算求出 x=0 时函数近似极限,并修补图形缺口。 3. t=-2*pi:pi/10:2*pi; y=sin(t)./t; tt=t+(t==0)*eps; yy=sin(tt)./tt; subplot(1,2,1),plot(t,y),axis([-7,7,-0.5,1.2]), xlabel(t),ylabel(y)

文档评论(0)

1亿VIP精品文档

相关文档