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 个评论
Jan
2016-11-25
Hints:
Y0 = ff(end,1:4);
Omit the "clear ff Resp", because this is not useful in Matlab but wastes time only.
回答(1 个)
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.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!