Handles: How do They Work?
Afficher commentaires plus anciens
Hey all,
I'm trying to create an ODE function which measures the abundance of L and G. My problem is getting other non-variable parameters into the darn thing. I think that I can accomplish this with the use of handles, but I can't for the life of me figure out how to set up and call them.
This is the function I run...
function [g]=IFFL_TC(t0,t1,t2,A0,A1,I,Smax,Smin,EffG,dl,dg,L,G)
x = [L,G];
P = [t1,t2,A0,A1,I,Smax,Smin,EffG,dl,dg];
Param = @P; % This is where it all gets a little hazy...
[t,x] = ode45('IFFL_TC_eqns',[0 t0],x);
%%Plus more stuff that works fine
IFFL_TC_eqns is a system of 2 ODEs that spits out L and G. What I can't figure out how to pack all the necessary parameters into P and then unpack them from within IFFL_TC_eqns. I'm pretty sure it's simple, but the syntax is killing me.
Thanks in advance,
-DM
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Ordinary Differential Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!