Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Introduction to Profiling Models

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

Activating the Profiler

Simulink® Profiler can be activated by selecting Show Profiler Report from the Performace 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')

Creating a Temporary Working Directory

The profiler writes HTML-files out to the current directory, so first change to a temporary directory.

temp = tempname;
mkdir(temp)
originalDir = pwd;
cd(temp)

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 two HTML-files: a detail file and a summary file. Simulink stores the summary and detail files in MATLAB's working directory and displays the summary file in the MATLAB help viewer when the simulation ends. Hyperlinks in the summary enable you to review the detailed timing information for each function.

Cleaning Up

Close the model and remove the generated files.

bdclose(modelName)
cd(originalDir)
rmdir(temp,'s')
Was this topic helpful?