Save the loop results in array (if scalar data) or in cell arary (in vector results) are good ways to handle the data. From the code it has been observe that r is array vector, I suppose you are considering last three r vectors generated by r, please do accordingly, you may use cell array
r=cells(1,maxstep);
r{1}=rl;
for i=1:maxstep
r{i}=
end
Here all evaluated values of r are saved in the cell array. Using indexing, you can get the lat three cell elements
Hoep you can modify the code and do that same. Any issue let me know
0 Comments
Sign in to comment.