注册 登录
编程论坛 Matlab

求大神这个ode23中错误,如何解决

洛奇cue 发布于 2017-06-14 08:22, 3162 次点击
function xdot=difeq(t,x)
    xdot=zeros(2,1);
    xdot(1)=x(2);
    xdot(2)=(-3554.634*x(1).^2/(84.903+x.^2).^3/2+1129947.84*x/(x.^4-133.634)-156.8*x/(3*x.^2+34.68)*(x/(x+3.4)+3.4/x)-1210251.95/(x.^4-133.634))/(41.867*x/sqrt(84.903+x.^2)-41.867)
    end
tspan={0 20};
x0={0 1};              %Initial conditions
[t,x]=ode23('difeq',tspan,x0);
plot(t,x)
??? Undefined function or method 'minus' for input arguments of type 'cell'.

Error in ==> odearguments at 76
  htspan = abs(tspan(next) - t0);

Error in ==> ode23 at 172
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...
 
0 回复
1