How to use timer and To Workspace

1 visualizzazione (ultimi 30 giorni)
A il 26 Ago 2021
Modificato: A il 26 Ago 2021
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.

Risposte (0)


Scopri di più su Simulink Functions in Help Center e File Exchange




Community Treasure Hunt

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

Start Hunting!

Translated by