Using a matrix of solution elements outside of ode45
Show older comments
I am working on a problem for a falling parachute where the forces are proportional to velocity squared. I am using ode45 which calls a function which includes the differential equations of motion. ode45 outputs to the main program time, distance, and velocity. Within the function, I have built a matrix which includes time, distance, velocity, glide path angle, and acceleration using persistent variables. I would like to use this complete matrix after ode45 has finished in the main program but I only get the variables for the last time period and not the whole matrix. How do I make the whole matrix from the function inside the ode45 loop available outside ode45 in the main program?
Answers (2)
Mischa Kim
on 10 Dec 2016
0 votes
Duncan, how about simply re-building the matrix after the ode45-call? I assume all those variables are dependent on time, distance, and velocity.
For a more detailed analysis, please attach your code.
2 Comments
Duncan McIntosh
on 11 Dec 2016
Edited: Walter Roberson
on 12 Dec 2016
Duncan McIntosh
on 11 Dec 2016
Walter Roberson
on 12 Dec 2016
Edited: Walter Roberson
on 12 Dec 2016
0 votes
1 Comment
Duncan McIntosh
on 12 Dec 2016
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!