Determining Profiler Coverage

When you run the Profiler on a file, some code might not run, such as a block containing an if statement.

To determine how much of a file ran when you profiled it, run the Coverage Report:

  1. In the Command Window, type profile viewer.

  2. Profile a MATLAB® code file in the Profiler.

    For detailed instructions, see Profiling for Improving Performance.

  3. Ensure the Profiler is not currently profiling.

    The Profiler displays a Start Profiling button when the Profiler is not running. If the Profiler is running, then do one of the following:

    • Wait for it to stop profiling before proceeding to step 4.

    • Click Stop Profiling.

      The Stop Profiling button is available only when the Profiler is running.

  4. Use the Current Folder browser to navigate to the folder containing the file for which you ran the Profiler.

      Note:   You cannot run reports when the path is a UNC (Universal Naming Convention) path; that is, a path that starts with \\. Instead, use an actual hard drive on your system, or a mapped network drive.

  5. On the Current Folder browser, click , and then select Reports > Coverage Report.

    The Profiler Coverage Report appears, providing a summary of coverage for the file you profiled. In the image that follows, the profiled file is lengthofline2.m.

  6. Click the Coverage link to see the Profile Detail Report for the file.

Was this topic helpful?