Is there a way to check the data being sent to workspace from my Simulink model so I can choose to stop the simulation?

2 次查看(过去 30 天)
I have a Simulink Multibody model that outputs position data to the workspace after it is done simulating. I have been running the simulation using the sim() command in a MATLAB script. Is there a way that I can run the simulation in MATLAB while checking the position output and then stop the simulation after I have reached a certain position? Thank you.

回答(1 个)

Chidvi Modala
Chidvi Modala 2019-7-17
I understand that you want to stop Simulink simulation when a certain condition is met.
Use the Stop Simulation block with an appropriate logical input to the block.
Alternately you can use Assertion block to halt the simulation and display an error message.

类别

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

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by