北科大数学实验第二次报告.doc
文本预览下载声明
《数学实验》报告
实验名称??MATLAB基础知识
学 院
专业班级?? ?? ??
姓??? 名????????
学??? 号??????
??
2013年5月
【实验目的】
学会用MATLAB绘制二维曲线、三维曲线、三维曲面,掌握gtext, legend, title, xlabel, ylabel等指令用法。
【实验任务】
P34 3 P79 1,3,5
【实验程序】
P34 第3题
n=1;
sum=0;
while n=50;
sum=sum+prod(1:n);
n=n+1;
end
sum
P79第1题
x=0:pi/50:4*pi;
y1=exp(x/3).*sin(3*x);
y2=exp(x/3);y3=-exp(x/3);
plot(x,y1,b*),hold on
plot(x,y2,r-.,x,y3,r-.),grid on
P79第3题
x1=-pi:pi/100:pi;
y1=x1.*cos(x1);
x2=pi:pi/100:4*pi;
y2=x2.*tan(1./x2).*sin(x2.^3);
x3=1:0.1:8;
y3=exp(1./x3).*sin(x3);
subplot(131),plot(x1,y1,rp),grid on
axis tight
title(y1=x1cosx1)
xlabel(x?á),ylabel(y?á)
gtext(y1=x1cosx1)
legend(y1=x1cosx1)
subplot(132),plot(x2,y2,c-),grid on
axis tight
title(y2=x2tan(1/x2)sin(x2^3))
xlabel(x?á),ylabel(y?á)
gtext(y2=x2tan(1/x2)sin(x2^3))
legend(y2=x2tan(1/x2)sin(x2^3))
subplot(133);plot(x3,y3,mx),grid on
axis tight
title(y3=e^(1/x3)sin(x3))
xlabel(x?á),ylabel(y?á)
gtext(y3=e^(1/x3)*sin(x3))
legend(y3=e^(1/x3)sin(x3))
P79 第5题
t=0:pi/50:20*pi;
x=t.*cos(pi/6.*t);
y=t.*sin(pi/6.*t);
z=2*t;
plot3(x,y,z),grid on
xlabel(x?á x=tcos(pi/6t))
ylabel(y?á y=tsin(pi/6t))
zlabel(z?á z=2t)
title(?2×??Y??£¨0 t 20pi£?)
legend(?2×??Y??)
【实验结果】
P34 第3题
P79第1题
P79第3题
P79 第5题
【实验总结】
上课认真听讲并练习了一些图形之后做题,感觉轻松了许多,再加上对软件的掌握熟练了,题目可以轻松搞定了。这次课我感受到了软件绘图功能的强大。
4
显示全部