Desktop Tools and Development Environment |
The following illustration summarizes the steps for profiling.
To profile an M-file or a line of code, follow these steps:
as the code is provided with MATLAB demos. It runs the Lotka-Volterra predator-prey population model. For more information about this model, type lotkademo
, which runs the demonstration.
To run a statement you previously profiled in the current MATLAB session, select the statement from the list box--MATLAB automatically starts profiling the code, so skip to step 3.
When the profiling is finished, the Profile time indicator becomes black and shows the length of time the Profiler ran.
This is not the actual time that your statements took to run, but is the time elapsed from when you clicked Start Profiling until profiling completed. If the time reported is much different from what you expected (for example hundreds of seconds for a simple statement), you might have had profiling on longer than you realized.
Profile time is CPU time. The total time reported by the Profiler is not the same as the time reported using the tic
and toc
functions or the time you would observe using a stopwatch.
Profiling a Graphical User Interface
You can run the Profiler for a graphical user interface, such as the Filter Design and Analysis tool included with the Signal Processing Toolbox. You can also run the Profiler for an interface you created, such as one built using GUIDE.
To profile a graphical user interface, follow these steps:
Profiling Statements from the Command Window
To profile more than one statement, follow these steps:
Profiler on
when MATLAB is not busy and the Profiler is running.
Changing Fonts for the Profiler
To change the fonts used in the Profiler, follow these steps:
The Profiler | Profile Summary Report |
© 1994-2005 The MathWorks, Inc.