%% Introduction to Profiling Models
% The following example, with the slAccelDemoF14 model, illustrates the 
% use of Simulink(R) Accelerator(TM) profiler feature.

% Copyright 1990-2007 The MathWorks, Inc.


%% Activating the Profiler
% To activate the Simulink(R) Profiler, in the Simulink Editor, on the
% *Debug* tab, under *Performance Advisor*, click *Activate Profiler*. You
% can also issue a |set_param| command at the MATLAB(R) 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. 
%
% <<../images/report.png>>


%% Cleaning Up
% Close the model.

bdclose(modelName)


displayEndOfDemoMessage(mfilename)
