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)
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.

Accepted Answer

Azzi Abdelmalek
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)

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!