File Exchange Pick of the Week

Our best user submissions

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the Original version of the page.

Simulink Pacer (Again) 2

Posted by Sean de Wolski,

Sean‘s pick this week is Simulink Pacing by MathWorks’ Simulink Development team.

Last summer, I highlighted the Simulink Pacer block as a means to slow a simulation down to a desired speed so you can see what’s happening. Yesterday, one my colleagues was demonstrating a customized prototype that streams data directly from Simulink to a cloud IoT platform. He elegantly used the new simulation pacing capabilities to slow the simulation so you could see the simulation in Simulink and the IoT dashboard updating at the same time.

Here’s the same model from last time. To enable simulation pacing in Simulink, select the “Simulation” drop down and then “Pacing Options”.

The new simulation pacing options allow me to drag the slider to adjust the speed as necessary.


Give R2018a a try and let us know what you think here.

Get the MATLAB code

Published with MATLAB® R2018a


Comments are closed.

2 CommentsOldest to Newest

Marian Kersting replied on : 1 of 2
Hey, i have a Question regarding this "RealTimePacer". Since i was googling i did not find an answer to the Topic of Codegeneration. Following this Link there is no information about it. (Often in other Articles there are Hints at the bottom.) Can you tell me more about it? ATM i use a Function i found at MatlabExchange and wrote a TLC-file for Code generation myself. It works. So far, but an implemented Option would be nicer. Usecase: I am generating Code of a Simulink Model and export it. Import in Eclipse and (cross-)compile it for a Singe Board Computer with Debian (and lots of input and OutputPorts). Greetings Marian Kersting
Greg Wolff replied on : 2 of 2
Hi Marian, As you probably know, the pacing option discussed above is strictly for simulation in Simulink. It looks like you want to automate the generation of a real-time scheduler (or at least attachment to the scheduler) in the generated code. This generally requires a code generation target. Not knowing exactly which Single Board Computer target you are targeting, and what MathWorks products you have available it’s difficult to make a specific recommendation at this point. As an example of the type of thing that you might be able to use, and potentially customize: This supports targeting “Linux” as an operating system. There is also documentation on “cross compiling” generated code on a Windows machine to Linux here: There are a fair number of options here, and I've just listed two above. You may want to consult MATLAB Answers, the MathWorks File Exchange (as you have done previously) or GitHub for examples like this: Hope this helps, -Greg