Not Enough input arguments
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Melissa
am 18 Mär. 2014
Kommentiert: Melissa
am 20 Mär. 2014
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 Kommentare
Akzeptierte Antwort
Andrei Bobrov
am 18 Mär. 2014
Bearbeitet: Andrei Bobrov
am 18 Mär. 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);
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!