How to run a model in simulink several times like a flowchart
2 次查看(过去 30 天)
显示 更早的评论
Hi,
I have a model in simulink which includes some function blocks. Now I want to run this model 10 times and each time compare the output of the model to a value and if needed change an input for the next run. anyone can help?
0 个评论
回答(1 个)
Jon
2023-1-24
You can use the MATLAB sim command to run Simulink programatically in a loop, please see https://www.mathworks.com/help/simulink/slref/sim.html
2 个评论
Jon
2023-2-14
I think for what you describe it would make sense to run Simulink "externally" from a loop in MATLAB but you could try to put your workflow into a for iterator subsystem within Simulink https://www.mathworks.com/help/simulink/slref/foriteratorsubsystem.html
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subsystems 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!