I have some differential equations that I need to solve using MATLAB\'s ODE solvers. While the differential equations themselves are fairly simple, they depend on a lot of \"con
I don't see how your code, as written, can work since no one ever calls or points to someFunctionStep. Should that be the first input to ode15s?
In any case, you can write a separate someFunctionStep function that takes varargin or inputs. And then create an anonymous function with the constants. Pass that into ode15s.
--Loren
I would suggest creating specific "generator" functions for each system of ODEs you want to solve (based on Loren's suggestion to make use of anonymous functions). Here's what one might look like for your example:
function odeFcn = makeODE(j,k,l,m,n,o)
odeFcn = @(t,y) [-j*(k+y(1))/(l+y(1)); -m*(n+y(2))/(o+y(2))];
end
Each generator function would accept a set of input parameters and use them to create an anonymous function, returning the function handle as an output from the generator function. Here's how you can then use it:
outputVector = ode15s(makeODE(a,b,c,d,e,f), [0,endTime], [x,y]);