Effacer les filtres
Effacer les filtres

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); ''.???

2 vues (au cours des 30 derniers jours)
[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);

Réponses (1)

Walter Roberson
Walter Roberson le 24 Mai 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 commentaire
Steven Lord
Steven Lord le 24 Mai 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.

Connectez-vous pour commenter.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by