Not Enough input arguments
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I get the not enough input arguments for a function I made and am trying to pass through ode23. I followed the ode23 syntax but I'm not sure why it is caught up at this point.
My function file:
1-function dydx=solver(x,y)
2-dydx=x-y
How I call my function file:
1-xspan=[0,1];
2-y0=2;
3-
4-[xo,yo]=ode23(solver,xspan,y0)
this also results in an error, supposedly line 4 but it won't say what the error is.
Here are my error messages:
Error using solver (line 2) Not enough input arguments.
Error in ME140_inclassactivity16_runge_kutta (line 4) [xo,yo]=ode23(solver,xspan,y0)
0 commentaires
Réponse acceptée
Andrei Bobrov
le 18 Mar 2014
Modifié(e) : Andrei Bobrov
le 18 Mar 2014
solver = @(t,y)t - y;
xspan = [0,1];
y0 = 2;
[xo,yo] = ode23(solver,xspan,y0);
if solver as m - file (your case):
[xo,yo] = ode23(@solver,xspan,y0);
Plus de réponses (0)
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!