> I was able to make my sample work by adding a third parameter to the declaration of f and then using this call: > [t_steps,s1]=ode45(@(t,y) f(t,y,beta), t_steps, s0, options); > > But I can't say I understand what it's doing. And I note that t and y are not given values anywhere before the @(t,y) part of that command. But the correct values are being passed into the function (at least the first time) and I'm getting the results I expect.
It defines an anonymous function that takes two values, named t and y inside this function, and then calls f(t,y,beta). A very useful idiom.