请问下列MATLAB程序哪里错误
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/19 02:55:15
请问下列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('阻尼振动曲线');
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('阻尼振动曲线');
改好后可运行,已调试
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('阻尼振动曲线');
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('阻尼振动曲线');