combining vectors of varying lengths

1 view (last 30 days)
Angus Barr
Angus Barr on 20 Oct 2018
Answered: madhan ravi on 20 Oct 2018
Hello, I have a for loop which is running an ODE solver, it is calculating how 4 variables change with time, my issue is that another variable, T, which the first 4 variables depend on is also varying with time. To solve this I had made an ODE loop in which the ode is solved over the first one hundredth of the total time, then T is recalculated at the new time, and the next hundredth of the ode is solved, as a way to approximate the true ode solution. My issue comes from when I try to combine the 4 ode outputs and there time output, I want to chain all the time values from the ode into one long vector, but since the exact number of data points released by the ode changes each time, matlab is proving difficult to combine the time output each time into the existing time vector. Can anyone help?

Answers (1)

madhan ravi
madhan ravi on 20 Oct 2018
time(:) %transforms into. column vector

Categories

Find more on Programming 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!