|MATLAB Function Reference|
Tool for optimizing and debugging M-file code
As an alternative to the
profile function, select View -> Profiler from the desktop.
profile function helps you debug and optimize M-files by tracking their execution time. For each function in the M-file,
profile records information about execution time, number of calls, parent functions, child functions, code line hit count, and code line execution time. Some people use
profile simply to see the child functions; see also
depfun for that purpose. The Profiler user interface, opened with
profile viewer, provides information gathered using the
profile function, but presents the information in a different format from
profile opens the Profiler graphical interface, a tool for assessing M-file performance to help you identify potential performance improvements. It is based on the results returned by the
profile function, but presents the information a different format than the
profile report. The
report function provides some options not available with the Profiler, including saving the reports to a file.
profile, clearing previously recorded profile statistics.
profile for the set of functions specified by
level, clearing previously recorded profile statistics.
|Value for level
||Functions profile Gathers Information About
||M-functions, M-subfunctions, and MEX-functions;
||Same functions as for
||Same functions as for
profile, clearing previously recorded profile statistics, and recording the exact sequence of function calls. The
profile function records up to 10,000 function entry and exit events. For more than 10,000 events,
profile continues to record other profile statistics, but not the sequence of calls.
profile without clearing previously recorded statistics.
profile clears the statistics recorded by
profile, generates a profile report in HTML format, and displays the report in your system's default Web browser. This report contains some different information than what is available in the Profiler reports.
profile, generates a profile report in HTML format, saves the report in the file
basename in the current directory, and displays the report in your system's default Web browser. Because the report consists of several files, do not provide an extension for
profile and displays in a figure window a bar graph of the functions using the most execution time.
s = profile( displays a structure containing the current
profile status. The structure's fields are
stats = profile(' suspends
profile and displays a structure containing
profile results. Use this function to access the data generated by
profile. The structure's fields are
||Array containing list of all functions called
||Array containing function call history
To see an example of a profile report and profile plot, as well as to learn more about the results and how to use profiling, see Measuring Performance" and "The profile Function" in MATLAB Programming documentation.
Follow these steps to run
profile and create a profile report.
See "Measuring Performance, The Profiler, and The profile Function in the MATLAB Programming documentation.