How to extract a value of a variable in Simulink?

3 views (last 30 days)
I want to extract a value of a variable in an algebraic loop, if the certain criteria is fulfilled. For example I want X to be equal 300, if it is, i want it to take take this value and use in another place in simulation.
I tried to stop simulation if the criteria is fulfilled but then I cannot use the value of X anymore. With To Workspace Block, X is changing in time, so I can only extract the matrix X=[0 0 0 ... 300]
Is there a way for example to stop subsystem, but the rest of the simulation still runs. (when I used Stop Block whole simulation stopped).
Any idea how can i extract this last value of X?

Answers (0)

Categories

Find more on Programmatic Model Editing 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!