MATLAB Examples

Introduction to Profiling Models

The following example, with the slAccelDemoF14 model, illustrates the use of Simulink® Accelerator™ profiler feature.

Contents

Activating the Profiler

Simulink® Profiler can be activated by selecting Show Profiler Report from the Performance Tools under the Analysis menu or by issuing a set_param command at the MATLAB® command prompt.

modelName = 'slAccelDemoF14';
load_system(modelName)
set_param(modelName,'Profile','on')

Running the Simulation

While the simulation runs, the profiler is collecting data for the report. Once the simulation is complete it creates an HTML report.

open_system(modelName)
sim(modelName)

Viewing the Report

The generated report consists of a summary HTML-files. Hyperlinks in the summary enable you to review the detailed timing information for each function.

Cleaning Up

Close the model.

bdclose(modelName)