知ing

MATLAB程序设计与应用(第二版)

刘卫国 编 / 高等教育出版社

麋麓~七 上传

查看本书

第一题

h=figure('MenuBar','figure','color','r','WindowButtonDownFcn','disp(''Left Button Pressed'')')

%第二题

x=-2:0.01:2;

y=x.^2.*exp(2*x);

h=line(x,y);

set(h,'color','r','linestyle',':','linewidth',2)

text(1,exp(2),'y=x^2*exp(2*x)')

%第三题

t=0:0.00001:0.001;

[t,x]=meshgrid(t);

v=10*exp(-0.01*x).*sin(2000*pi*t-0.2*x+pi);

axes('view',[-37.5,30]);

h=surface(t,x,v);

title('v=10*exp(-0.01*x).*sin(2000*pi*t-0.2*x+pi)');

xlabel(Ct'),ylabel('x'),zlabel('v')

%第四题

x=0:0.01:2*pi;

y1=sin(x);

y2=cos(x);

y3=tan(x);

y4=cot(x);

subplot(2,2,1);

plot(x,y1);

subplot(2,2,2);

plot(x,y2);

subplot(2,2,3);

plot(x,y3);

subplot(2,2,4);

plot(x,y4);

第五题

cylinder(5);

light('Position',[0,1,1]);

material shiny


查看更多