Main Content


Time over which code section execution time measurements are made (MATLAB code generation)



Time = NthSectionProfile.Time returns a time vector corresponding to the period over which execution times are measured for the code section.


collapse all

Open this example to obtain the files for this tutorial:

  • kalman01.m — MATLAB® function for the Kalman estimator

  • test01_ui.m — MATLAB file to test kalman01.m

  • plot_trajectory.m — File that plots actual target trajectory and Kalman estimator output

  • position.mat — Input data


Set up and run a SIL execution.

config = coder.config('lib');
config.GenerateReport = true;

config.VerificationMode = 'SIL';
config.CodeExecutionProfiling = true;

codegen('-config', config, '-args', {zeros(2,1)}, 'kalman01');

coder.runTest('test01_ui', ['kalman01_sil.' mexext]);

At end of the execution, you see the following message.

To terminate execution: clear kalman01_sil
Execution profiling report available after termination.

Click the link clear kalman01_sil.

### Stopping SIL execution for 'kalman01'
    Execution profiling report: report(getCoderExecutionProfile('kalman01'))

Create a workspace variable that holds execution time data.


Get the profile for the second code section.

secondSectionProfile = executionProfile.Sections(2);

Get time vector for code section.

time = secondSectionProfile.Time;

Input Arguments

collapse all

Object generated by the coder.profile.ExecutionTime property Sections.

Output Arguments

collapse all

Time, in seconds, over which measurements are made for code section. Returned as a vector.

Version History

Introduced in R2013a