tPool = [0,1,2,4,8];
...
for k = 1:numel(tPool) - 1
Concerning: "If I add the parameters Aap,Acp as input parameters of my anonymous function then I get: Not enough input arguments. Error in verysimple3>@(l,Tp,Aap,Acp)myODE(l,Tp,Aap,Acp)"
The ODE integrator calls the function to be integrated with 2 input arguments. The anonymous function is created to add further inputs. Therefore this works:
[l, Tp]=ode45(@(l,Tp) myODE(l,Tp,Aap,Acp),Pool(k:k+1),y0);
because here ODE45 provides the 2 inputs (l, Tp), the anonymous function appends 2 further inputs. With:
[l, Tp]=ode45(@(l,Tp,Aap,Acp) myODE(l,Tp,Aap,Acp), Pool(k:k+1), y0);
ODE45 is instructed to provide 4 inputs, but it can offer 2 only.
By the way, using "l" (lowercase L) as variable causes troubles freuqently, when it is confused with a "1" (one) or "I" (uppercase i).
Best Answer