How to program loop in simulink
Show older comments
I want to create a auto-update of my controller parameters using for example PSO. I programmed in Integrated-matlab function block. The PSO requires looping for a defined population.However if i write a sim callout as below:
simopt = simset('solver','ode5','SrcWorkspace','Current','DstWorkspace','Current'); % Initialize sim options [tout,xout,yout] = sim('ExternePID',[0 30],simopt);
within for-loop of defined population in my integrated matlab function, then the whole system is running without ending. How to fix this? I need a loop in a simulink that can calculate the fitness of each population/iteration of normal PID-control system. The matlab version is R2015b. Thank you in advance sincerely, Hanif
Answers (0)
Categories
Find more on Discontinuities 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!