Using odesolver with functions that have many inputs
Show older comments
I'm trying to use ode45 to integrate a first order differential equation. The first line of my function m-file is
function dEds = dPdE(s, E, U0, H0, mu, T, t, initial, final,timestep)
s is my independent variable, and E(s) is what I am solving for. All the other variables are matrices or scalars, and are used in the m-file. My question is, when using ode45, how do I specify these other variables? On this page
other inputs are being put in after the (blank) options, and I verified for myself that it can work, but I haven't seen any documentation refer to that. Furthermore it doesn't seem to be working when I try and solve my equation:
[s E]=ode45(@dPdE,[0 5],E(321),[],U0,H0,mu,5,3.2,2,3,.01);
It says too many input arguments. How can I make this go?
(A more trivial question I have is whether I need to put s as an input argument if the function never uses it.)
Accepted Answer
More Answers (0)
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!