필터 지우기
필터 지우기

how to solve this error occuring while solving ODE ''Error in ode23 (line 114) odeargumen​ts(FcnHand​lesUsed, solver_name, ode, tspan, y0, options, varargin); ''.???

조회 수: 1 (최근 30일)
[t,x] = ode45('phprocess',[0 5000],[0 0]);
Error using phprocess
Too many input arguments.
Error in odearguments (line 87)
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ode45 (line 115)
odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);

답변 (1개)

Walter Roberson
Walter Roberson 2017년 5월 24일
You have defined your function phprocess to not expect any arguments, or to only expect one argument. It needs to accept at least two arguments.
Also, using strings as the first argument to the ode*() functions became obsolete as of MATLAB 5.1, 20 years ago. You should use a function handle,
[t,x] = ode45(@phprocess, [0 5000], [0 0]);
  댓글 수: 1
Steven Lord
Steven Lord 2017년 5월 24일
Actually, function handles were introduced in MATLAB 6.0 (release R12). That was around 17 years ago, I believe, since the release after that (release R12.1) came out right around when I started at MathWorks. So not 20 years, but we have recommended function handles over char vectors as the inputs to the ODE solvers for quite a while now.

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

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by