MATLAB: Real-Time in R2011b

real timereal time workshopsimulinksimulink coder

Hi,
I have used simulink before to create an aircraft simulation that runs in what I call "simulation" time.
I now need to set up a model which runs in a real-time environment. At the moment the simulation runs faster than real-time.
Does anyone have any guidance on how to set up the model such that I can make it run in real-time in MATLAB/Simulink R2011b. I have the Simulink Coder blockset.
Thank you in advance for any help with this.

Best Answer

To make the simulation "really" in real-time, you need to run the simulation in a target (micro-controller) with a real-time operation system (RTOS). Your PC or MAC is unlikely a real-time target. xPc Target can boot your PC as a real-time target but that's a different story.
If you just want to slow down your simulation to close to real-time, you can use Guy Rouleau's S-function.