ODE45() & Importing Variables in to Functions Inside It
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am using ode45 on my function; "derivs_func_5". It provides derivatives for ode45.
That function needs to have a value imported in to it "r" before ode45 hits it to provide those derivatives.
This is what the working code looks like:
[t,coords] = ode45(@derivs_func_5,[t_init t_fin],[x_init y_init v_x_init
v_y_init],ode_options);
This is what I am trying to do but matlab is not letting me do:
r=5;
[t,coords] = ode45(@derivs_func_5(r),[t_init t_fin],[x_init y_init v_x_init
v_y_init],ode_options);
Is there any way to set input variables for a function what appears inside ode45 function?
thanks
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 8 Dez. 2012
[t,coords] = ode45(@(t,y) derivs_func_5(t,y,r), [t_init t_fin],[x_init y_init v_x_init v_y_init], ode_options);
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!