I want to solve some coupled differential equations using ode45, but here I have to pass some constants in that function as well. How will the code be written.
1 view (last 30 days)
Show older comments
I want to solve some coupled differential equations using ode45, but here I have to pass some constants in that function as well. How will the code be written.
1 Comment
Walter Roberson
on 17 Feb 2013
Please read the guide to tags and retag this question. http://www.mathworks.co.uk/matlabcentral/answers/43073-a-guide-to-tags
Accepted Answer
Azzi Abdelmalek
on 17 Feb 2013
Edited: Azzi Abdelmalek
on 17 Feb 2013
function dy=yourfunction(t,y,k,g) % k, g are your constants
%your code
To call ode45
[t,y]=ode45(@(t,y) yourfunction(t,y,k,g),tspan,y0)
0 Comments
More Answers (0)
See Also
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!