查看单个帖子
旧 2007-11-29, 15:25   #1
baggio198310
初级会员
 
注册日期: 2007-11-29
帖子: 5
声望力: 0
baggio198310 正向着好的方向发展
默认 【求助】关于ode45的问题

请各位大侠帮帮我

在chap1_2.m中的程序:
………………
………………
………………
[tt,xx]=ode45('chapl_2f',tSpan,xk,[],para);
………………
在chap1_2f.m中的程序是:
function dy =chap1_2f(t,y,flag,para)
u=para;
J=0.0067;
B=0.1;
dy=zeros(2,1);
dy(1)=y(2);
dy(2)=-(B/J)*y(2)+(1/J)*u;

可是运行后总是报错:
??? Error using ==> feval
Undefined command/function 'chapl_2f'.

Error in ==> funfun\private\odearguments at 110
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.

Error in ==> ode45 at 173
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...

Error in ==> chapl_2 at 14
[tt,xx]=ode45('chapl_2f',tSpan,xk,option,para);


敢问各位高手是什么问题?
baggio198310 当前离线   回复时引用此帖