How to run simulation in real time
Show older comments
I want to run my simulation in real time so that I can manually change inputs while the simulation is running. Is there a setting to change so that it runs in real time?
Accepted Answer
More Answers (1)
Fangjun Jiang
on 30 Sep 2011
0 votes
You can not run a Simulink simulation on your computer in real time. "Real time" here means the clock in Simulink goes at the same speed as the clock on the wall or on your watch.
To run a real-time simulation, you need to generate the code from your model, compile it and then run it in a computer or micro-controller with a Real-Time Operation System (RTOS). The computers we use use usually don't have RTOS. That's why a real-time simulation can't be run.
However, I think you are probably asking if you can change the input or a parameter while the simulation is running, not necessarily has to be in real time. While the simulation is running, you can double click any source block (e.g. a Constatn block) and change it's value, the simulation will pause and then resume, take the new value effective. Other parameters of the model can be changed too, although it takes more advanced technique.
Categories
Find more on Simulink Real-Time 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!