Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

라이선스가 부여된 사용자만 번역 문서를 볼 수 있습니다. 번역 문서를 보려면 로그인하십시오.

Use Profiler to Determine Code 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 MATLAB® executed when you profiled it, run the Coverage Report.

  1. Profile your MATLAB code file. For more information, see Profile to Improve Performance or the profile function.

  2. Ensure that the Profiler is not currently profiling.

    • In the Profiler, a Stop Profiling button displays if the Profiler is running. If the Profiler is running, click the Stop Profiling button.

    • At the command prompt, check the Profiler status using profile status. If the ProfilerStatus is 'on', stop the Profiler by typing profile off.

  3. Use the Current Folder browser to navigate to the folder containing the profiled code file.

      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.

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

    The Profiler Coverage Report opens, providing a summary of coverage for the profiled file. In the following image, the profiled file is lengthofline2.m.

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

    Note:   MATLAB does not support creating Profiler Coverage Reports for live scripts. When creating a report for all files in a folder, any live script in the selected folder is excluded from the report.

See Also

More About

Was this topic helpful?