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)
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

Answers (1)

Adam
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.

Categories

Find more on Language Fundamentals in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!