MATLAB Answers


matlab GUI starts very slow, possible to speed up?

Asked by legendbb
on 13 May 2013

As subject,



We need to know a little more.

  1. Is it a GUIDE GUI?
  2. Is it a programatic gui or a class?
  3. What initializations happen?
  4. How extensive is it?

Thanks for all comments, it's a GUIDE GUI with about 150 objects (compiled size 1.22MB); initialization if it's in OpeningFcn() does nothing other than default.

All I can imaging is the time took to linked with MCR. It can tool to 15 sec to open up.

Thank you very much for Jan's point about profiler. I will dig in.



No products are associated with this question.

2 Answers

Answer by Walter Roberson
on 14 May 2013

Probably not much. You can reduce the number of directories in your matlab path to reduce some of the startup time. You can pcode your files to reduce execution time a little (probably not much unless your code is huge.)

You can make sure your computer has lots of memory, and have something that reads all of your files ahead of time so that they are in disc cache. This is done automatically on MS Windows systems in quite new versions of MATLAB.

If you are accessing hard-disk, you can move everything onto solid state storage.


Answer by Jan Simon
on 14 May 2013

The profiler reveals, where the most time is spent. I suggest to find this bottleneck and post the code here.

In a complex GUI with a lot of elements, the rendering cna consume a lot of time. So add a drawnow inside the code, otherwise the profiler cannot consider the correpsonding time, because the rendering is started, when the control returns to the command line and therefore after the profiler has finished the measurements.


Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!