How to use timer and To Workspace
2 views (last 30 days)
Show older comments
I want to run Simulink, use To Workspace to get data, and then use the values in the data to compute and find a value.
However, I have read that To Workspace does not make the data available until the simulation is paused or stopped.
I would like to compute and obtain a value in the middle of a run, or in real time, as Simulink starts and ends in 7 minutes.
So, using a timer, after 3 minutes from the start of the run, stop the run once, and when the data in the To Workspace becomes available, perform the calculation and find a value.
However, since we are using an if statement in the middle of the calculation, if the condition is not satisfied, we want to release the stop and simulate the remaining 4 minutes.
Alternatively, I would like to use To Workspace to display the variable names in the base workspace from the start of the run, so that the data can be retrieved and used in the calculation in real time.
It would be appreciated if you could include the programme in your answer.
Find more on Simulink 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!