getprofiledata

Returns collected profile data.

Syntax

result=getprofiledata()

Outputs

result
A cell array containing the collected profiling data.
Dimension: cell

Example

Simple example:
profile(true)
a = [];
for j=1:10
               for k=1:j
                              a = [a sqrt(j*k)];
               end
end
profile(false)
getprofiledata()
ans =
{
[1,1] C:/Test files/675/Untitled1.oml
[1,2] [Matrix] 5 x 3
2 0 1
3 0 1
4 0 10
5 0 55
8 0 1
}

Comments

The cell array returned by this function has two columns. The first column consists of strings representing the file names where the profiled code resides. The second column consists of matrices with the profiling data.

Each matrix has three columns.
  • The first column is the line number (from the corresponding file).
  • The second column is the amount of time spent executing that line.
  • The third column is the number of times that line was executed.