how to solve this error occuring while solving ODE ''Error in ode23 (line 114) odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin); ''.???
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
[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);
0 commentaires
Réponses (1)
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
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.
Voir également
Catégories
En savoir plus sur Ordinary Differential Equations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!