Borrar filtros
Borrar filtros

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 visualización (últimos 30 días)
[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);

Respuestas (1)

Walter Roberson
Walter Roberson el 24 de Mayo de 2017
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 comentario
Steven Lord
Steven Lord el 24 de Mayo de 2017
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.

Iniciar sesión para comentar.

Categorías

Más información sobre Ordinary Differential Equations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by