Main Content

Application and Driver Scripts

These examples show the features of Simulink® Real-Time™. Use these scripts as a starting point for writing your scripts for creating and testing real-time applications.

These examples include general applications examples and driver examples. You can access the general application and driver examples through MATLAB® Help. In the help window, click Real-Time Simulation and Testing > Simulink Real-Time > Examples.

General Examples

The general application examples include models and scripts.


File Name

Real-time parameter tuning and data logging

Parameter Tuning and Data Logging

Log signal data with the Simulation Data Inspector to a file on the development computer

Parameter Tuning and Data Logging

Create a custom client application to interface with the target computer

Add App Designer App to Inverted Pendulum Model

Concurrent execution of a model by using the Simulink Real-Time profiling tool

Concurrent Execution on Simulink Real-Time

Driver Examples

These driver examples include models and scripts showing the use of driver blocks in a Simulink Real-Time environment. To run some of these examples, you must install specific hardware.

  • Analog and digital I/O

  • ARINC 429

  • Asynchronous events

  • Audio

  • CAN (CAN_MESSAGE data types)

  • Counters, timers, pulse width modulators (PWM)

  • Digital signal processing

  • Encoders

  • EtherCAT®

  • FPGA

  • J1939

  • MIL-STD-1553

  • Precision Time Protocol (PTP)

  • Ethernet

  • RS-232

  • Shared/reflective memory

  • UDP

Edit Scripts

To locate and edit an example such as Apply Simulink Real-Time Model Template to Create Real-Time Application:

  1. Open the example scripts folder. In the MATLAB Command Window, type:

    cd (fullfile(matlabroot,'examples','slrealtime','main'))
  2. Use the descriptive names of the example scripts (similar to the example title) to find the script.

  3. Open the script. For example, in the MATLAB Command Window, type: