Creating a matrix per iteration
Show older comments
Hello,
I'm trying to create a new matrix for each iteration of my loop. Here's the problem, I have to test 3 differential equations solvers, i.e. ode45, ode23, ode15s. I'd like to save the result of each loop in a matrix.
Here's the code :
for i=1:5
for j=1:5
options(i,j) = odeset ('RelTol',10^(-i),'AbsTol',10^(-j));
[T1,X]=ode45(@odefunction,[0 5],[0 5],options(i,j));
[T2,Y]=ode23(@odefunction,[0 5],[0 5],options(i,j));
[T3,Z]=ode15s(@odefunction,[0 5],[0 5],options(i,j));
end
I don't know the size of the matrix since the result of each ode gives a different size.
Thank you.
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!