I have the following code, where I am using a different value of a parameter G in my ODE system (solving it w/ ode45) and want to plot each solution on the same graph. It isnt the same as IC's, as these are the same but the parameter varies. Currently I have:
G=i/20 %Saving that iterates value of G
[phi,y]=ode45(@(phi,y) odefun(phi,y,G), timerange, IC);
then I want to save all these y's without creating 20 vectors. Is there a way to save each vector y as a column of a matrix? I am very lost and any direction would be very helpful, I cannot find a thread or anythign on the helpcenter.
Thanks in advance