I want to create several files with the following simulation in decreasing order from 18700 to 15000 but my simulation keeps going off after the first iteration, I don't know whats wrong. I actually did this for the the acending order and it worked.
1 view (last 30 days)
Show older comments
for wb=18700:50:15000;
Para(9)= wb;
ff= ode5(@this_eq_of_motion,t,Y0,Para);
Resp=ff((Tend-50)*1/steptime:end,:);
save(strcat('NNres_to_WOB_', num2str(wb),'.mat'),'Resp','Para');
Y0 = [ff(end,1),ff(end,2),ff(end,3),ff(end,4)];
clear ff Resp
end
1 Comment
Jan
on 25 Nov 2016
Hints:
Y0 = ff(end,1:4);
Omit the "clear ff Resp", because this is not useful in Matlab but wastes time only.
Answers (1)
Adam
on 25 Nov 2016
You have to use
wb=18700:-50:15000
to do a decrementing loop else it just tries to increment by 50, finds it is beyond the end point of the loop and stops immediately.
0 Comments
See Also
Categories
Find more on Language Fundamentals 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!