How to use MATLAB Profiler

MATLAB has a built-in profiler that is very useful to profile your code and find out what script or function is taking the most time.

From GUI

To run a script in the profiler, open the script file and click Run and Time in the top menu. After running the script, the profiler gives a hyperlinked colorful graph of functions and the times they took.

From Command Window

The equivalent of the above operation in commands is:

profile on; run_my_script; profile off; profile viewer

Reference: profile

Tried with: MATLAB R2014a and Ubuntu 14.04

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s