Programming and Data Types    

File Listing

The third section lists the file and allows you to highlight lines where the most time was spent, among other options.

Information you can glean from the File listing report includes

Line Colors.   Lines are colored as follows. (This is not apparent in the printed documentation.)

Line Color
Example
Description
Green

Comment
Black

Line was executed
Gray

Line was not executed

Use the line colors to see which lines of code actually ran. This is useful not only to profile an M-file, but to debug or to see how an M-file works. Color highlighting by coverage, described next, is another way to view this information.

Color Highlighting.   In Color highlight code according to, click the type of highlight to change to that view. Time is selected in this example. (Note that Time is shaded pink to indicate it is selected, but that is not apparent in the printed documentation.)

These types of highlighting provide you with another view of the information to help you improve your code. They allow you to scan the report and hone in on areas for improvement at a quick glance. You can then view more details for those lines using the Time, Calls, and Acceleration Columns.

Type of Highlight
Examples
Description 
Time








Lines shaded pink used the most time. Among the shaded lines, the darkest pink used the most time, while the lightest pink used the least time. A line that is not shaded but has black text (rather than gray) ran, but was not among the lines using the most time.
Number of calls
From ode23


Lines shaded blue were called the most. Among the shaded lines, the darkest blue were called most frequently, while the lightest blue were called least frequently. A line that is not shaded but has black text (rather than gray) ran, but was not among the lines called most often.
Coverage

Lines shaded blue were called. Lines that are not shaded were not called.
All lines that are shaded use black text. Unshaded lines use gray text.
Acceleration

Lines shaded pink were accelerated using MATLAB performance acceleration tools. Lines that are not shaded were not accelerated.
No color

No lines are highlighted.

Time, Calls, and Acceleration Columns.   For each line of the M-file, there are five columns of information.

Column
Value or Example

 

Description 
time

Total time spent on that line, in seconds. If the line was called but no time is listed, the time was so insignificant that it was not captured. In this example, line 114 ran for .13 seconds.
calls

Number of calls to that line. In this example, line 114 was called once.
acc
. (dot)


A . (dot) indicates the line was accelerated by MATLAB performance acceleration tools.

x


An x indicates the line was not accelerated by MATLAB performance acceleration tools. Click the x to see information about why the line was not accelerated. For details on acceleration, see Performance Acceleration.
Line Number

The line number in the M-file. This example shows line 114. Click the line number to open your default editor to that line number.
While this is a convenient way to go to a line and modify it in your own M-files, do not modify functions provided with MathWorks products, that is, functions stored in $matlabroot/toolbox directories.
Code

The line of code. This example shows part of the line rtol =. Scroll to see more of the line. Click a function to go to its Profiler detail report, for example odeget.


  Profile Detail Report Using Information in the Profiler Reports