MATLAB Examples

Execution Time Measurement and Block Profiling

The example model "sldrtex_profiling" shows how to analyze model execution performance in Simulink Desktop Real-Time™. The example is a multirate multi-tasking model that performs a time-intensive operation of matrix multiplication and finding the minimum in the resulting matrix product. This is being done for two different matrix sizes at two different sample rates.

The task-level performance information is returned by the Execution Time block. The first output port shows the total time of execution of each base rate step of the entire model. The second output port shows time of execution of each task.

To further refine the performance analysis, one of the two tasks is instrumented to obtain block-level information. The added Timestamp blocks capture the timestamps of input and output signals of blocks that are to be investigated. By subtracting the timestamps for input and output signals, execution times of the blocks are obtained.

This example must be run in External Mode and requires Simulink Coder™.