필터 지우기
필터 지우기

Error using FEVAL and odearguments

조회 수: 3 (최근 30일)
Puru
Puru 2013년 6월 2일
What does this mean and what could be the possible reasons behind it?
------------------------------------
??? Error using ==> feval Undefined function or method 'pitch_fn.m' for input arguments of type 'double'.
Error in ==> odearguments at 98
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ==> ode45 at 172
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...
Error in ==> pitch_model1 at 41
[t,y] = ode45('pitch_fn.m',time , [q(1) q(2) q(3) qdot(1) qdot(2) qdot(3)] );
------------------------------------
I have ensured that both the script and function are in same folder. But i cant figure out any reason for the undefined function and errors below it.
I am trying solving ODE ( 2nd order, three variables) through ode45.
  댓글 수: 2
Jan
Jan 2013년 6월 2일
Which script and which function are in which folder? Is this folder included in Matlab's PATH?
Puru
Puru 2013년 6월 3일
pitch_model1.m is the script and pitch_fn.m is the function . They are in the folder, Pitch_model, and yes the folder is included in Matlab's path.

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2013년 6월 3일
Do not include the ".m" in the function name.
[t,y] = ode45('pitch_fn', time , [q(1) q(2) q(3) qdot(1) qdot(2) qdot(3)] );
Even better if you do not have a fairly old MATLAB is to use function handles:
[t,y] = ode45(@pitch_fn, time , [q(1) q(2) q(3) qdot(1) qdot(2) qdot(3)] );
  댓글 수: 1
Puru
Puru 2013년 6월 3일
Thank you, it worked!!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by