matlab程序哪里有错误 20
symseldd;ef=400;em=63;vf=0.75;vm=0.25;a=70;cm=8.92;ts=6;p=1;e=vm*em+vf*ef;m=a*vm*em*d...
syms e ld d;
ef=400;em=63;vf=0.75;vm=0.25;a=70;cm=8.92;ts=6;p=1;
e=vm*em+vf*ef;
m=a*vm*em*d./(2*vf*e*ts)-(a*vm*em*ef*cd/e/ts/ts).^(0.5);
n=vm*em*ld./(vf*ef*e)*d.*d.-2*ts*ld.*ld.*d./a/ef+4vf*e*ts*ts*ld.*ld.*ld./(3*a*a*vm*em*ef)*d.+4vf*e*ts*ts*ld.*ld./(p*a*vm*em*ef)-4*vf*cd*ld/a-vm*cm;
[d,ld]=solve(m,n);
错误提示
??? n=vm*em*ld./(vf*ef*e)*d.*d.-2*ts*ld.*ld.*d./a/ef+4vf*e*ts*ts*ld.*ld.*ld./(3*a*a*vm*em*ef)*d.+4vf*e*ts*ts*ld.*ld./(p*a*vm*em*ef)-4*vf*cd*ld/a-vm*cm;
|
Error: Missing variable or function. 展开
ef=400;em=63;vf=0.75;vm=0.25;a=70;cm=8.92;ts=6;p=1;
e=vm*em+vf*ef;
m=a*vm*em*d./(2*vf*e*ts)-(a*vm*em*ef*cd/e/ts/ts).^(0.5);
n=vm*em*ld./(vf*ef*e)*d.*d.-2*ts*ld.*ld.*d./a/ef+4vf*e*ts*ts*ld.*ld.*ld./(3*a*a*vm*em*ef)*d.+4vf*e*ts*ts*ld.*ld./(p*a*vm*em*ef)-4*vf*cd*ld/a-vm*cm;
[d,ld]=solve(m,n);
错误提示
??? n=vm*em*ld./(vf*ef*e)*d.*d.-2*ts*ld.*ld.*d./a/ef+4vf*e*ts*ts*ld.*ld.*ld./(3*a*a*vm*em*ef)*d.+4vf*e*ts*ts*ld.*ld./(p*a*vm*em*ef)-4*vf*cd*ld/a-vm*cm;
|
Error: Missing variable or function. 展开
1个回答
展开全部
标量乘向量还是用点乘吧。 把所有*改成 .*试试行不? function dy=fun5(t,y) dy=[(-5.*sin(t)*(5.*cos(t)-y(1))+5.*cos(t)*(5.*sin(t)-y(2)))*(5.*cos(t)-y(1))./((5.*cos(t)-y(1))^2+(5.*sin(t)-y(2))^2), (-5.*sin(t)*(5.*cos(t)-y(1))+5.*cos(t)*(5.*sin(t)-y(2)))*(5.*sin(t)-y(2))./((5*cos(t)-y(1))^2+(5.*sin(t)-y(2))^2)]; clear,clc close all [t,y]=ode45('fun5',[0,100],[10,0]); X=5.*cos(t); Y=5.*sin(t); figure(1) plot(X,Y,'r.') hold on plot(y(:,1),y(:,2),'*')
追问
还是不行,还是提示
Error: Missing variable or function.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询