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 次查看(过去 30 天)
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 个)

Adam
Adam 2016-11-25
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.

类别

Help CenterFile Exchange 中查找有关 Language Fundamentals 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by