请问下列MATLAB程序哪里错误clear allm=0.2;w=3;b=0.8;A=0.2;xf=dsolve('D2x=-w*w*x','Dx(0)=0,x(0)=A',''t);xd=dsolve('D2x=-2*b*Dx-w*w*x','Dx(0)=0,x(0)=A','t');t=linspace(0,8,200);xf1=eval(xf);xd1=eval(xd);hold onb=0.99*w;xd2=eval(xd);plot(t,xf1,
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/29 01:05:12
请问下列MATLAB程序哪里错误clear allm=0.2;w=3;b=0.8;A=0.2;xf=dsolve('D2x=-w*w*x','Dx(0)=0,x(0)=A',''t);xd=dsolve('D2x=-2*b*Dx-w*w*x','Dx(0)=0,x(0)=A','t');t=linspace(0,8,200);xf1=eval(xf);xd1=eval(xd);hold onb=0.99*w;xd2=eval(xd);plot(t,xf1,
请问下列MATLAB程序哪里错误
clear all
m=0.2;w=3;
b=0.8;A=0.2;
xf=dsolve('D2x=-w*w*x','Dx(0)=0,x(0)=A',''t);
xd=dsolve('D2x=-2*b*Dx-w*w*x','Dx(0)=0,x(0)=A','t');
t=linspace(0,8,200);
xf1=eval(xf);
xd1=eval(xd);
hold on
b=0.99*w;
xd2=eval(xd);
plot(t,xf1,':r',t,xd1,'-b',t,xd2,'-k',t,zeros(1,200),'-r');
legend('xf1','xd1','xd2');
axis([0,8,-0.25,0.25]);
title('阻尼振动曲线');
请问下列MATLAB程序哪里错误clear allm=0.2;w=3;b=0.8;A=0.2;xf=dsolve('D2x=-w*w*x','Dx(0)=0,x(0)=A',''t);xd=dsolve('D2x=-2*b*Dx-w*w*x','Dx(0)=0,x(0)=A','t');t=linspace(0,8,200);xf1=eval(xf);xd1=eval(xd);hold onb=0.99*w;xd2=eval(xd);plot(t,xf1,
改好后可运行,已调试
clear all
m=0.2;w=3;
b=0.8;A=0.2;
xf=dsolve('D2x=-w*w*x','Dx(0)=0,x(0)=A','t');
xd=dsolve('D2x=-2*b*Dx-w*w*x','Dx(0)=0,x(0)=A','t');
t=linspace(0,8,200);
xf1=eval(xf);
xd1=eval(xd);
hold on
b=0.99*w;
xd2=eval(xd);
plot(t,xf1,': r',t,xd1,'-b',t,xd2,'-k',t,zeros(1,200),'-r');
legend('xf1','xd1','xd2');
axis([0,8,-0.25,0.25]);
title('阻尼振动曲线');