MATLAB Suddenly Stopped Being Able to Plot
Show older comments
Initially, Matlab worked properly. Yesterday, I was midway through a for loop where I executed plotting functions and used drawnow. The code executed well 115 times, then, I noted it was taking too long. Using CTRL + C, I killed the program and tried to run again. It didn't run. I restarted matlab and restarted my PC and I couldn't run even once.
With some debugging, I noticed that any graphical functions don't run at all. I tired simple code, such as
figure();
or
plot([0,0],[0,1]);
and none of this runs. It starts executing (shows busy), but never finishes and never shows a plot/figure.
When I eventually kill the process by typing "ctrl+c" it gives me the following message: "Warning: Update encountered failures.". It seems that the plot runs, but doesn't display anything. Eventually, it tries to update something, but I don't know what. I know it's updating after it runs, because if I ran
tic; plot([0,0],[0,1]); toc;
I get a time and only after it gets stuck.
I tried deleting my entire installation, which I believe removes the directories, and reinstalling MATLAB. The problem persists.
5 Comments
What do you get as output if you type
which -all plot.m
? Is there a function you created and that shadows the MATLAB plot function ? Then rename it.
If not, you should consult MATLAB Technical Support:
Caniggia
on 12 Aug 2025
Torsten
on 12 Aug 2025
I think only support can help in your case.
Caniggia
on 12 Aug 2025
Gilberto Pin
on 22 Aug 2025
Edited: Gilberto Pin
on 22 Aug 2025
The same occurred to me on R2025a: it suddenly stopped to plot figures and hangs after any call to figure() and plot(...). Moreover, I get this warning after Ctrl+C: "Warning: Update encountered failures. ".
Simultaneously, also parallel computing toolbox is no more able to delete jobs and hangs indefitely, until Ctrl+C. Afer that, the same warning is displayed on command line: "Warning: Update encountered failures. "
BTW: no improvements after running: restoredefaultpath and rehash toolboxcache
Answers (3)
Star Strider
on 12 Aug 2025
0 votes
First, see if the path got corrupted.
Run these:
restoredefaultpath
rehash toolboxcache
from a script or your Command Window, then try plotting again.
4 Comments
Caniggia
on 12 Aug 2025
Star Strider
on 12 Aug 2025
My pleasure!
I am not certain what you did with respect to 'deleting the entire installation'. Simply uninstalling and reinstalling usually works. There are some other directories that may need to be manually deleted, however that is usually not necessary.
Please post the reply that MathWorks sends since that would be of interest to others with the same problem.
Caniggia
on 23 Aug 2025
Dave
on 23 Aug 2025
Yes, the same for me! I will say that I was able to diagnose this problem in about 15 minutes with the help of ChatGPT 5. The LLM gave me a list of things to try. Checking the startup script was #5 on the list and it was the right one. The LLM claims its because while the desktop is still initializing (and perhaps the graphics part isn't initialized yet), the startup is run. Those functions (and maybe one or two more I had in my startup) created a race condition that then hung the application.
Dave
on 23 Aug 2025
0 votes
I encountered this exact problem. It turns out that I had functions in my "startup.m" that tried to change the behavior of the graphics engine that no longer work (possibly trying to use fonts that are no longer available on my Mac????). If you have a "startup.m" file, temporarily move it to "startup_OLD.m" or some such and see if you get the ability to plot again.
William
on 11 Sep 2025
0 votes
I had the same problem and it was solved when i restarted r2025 and waited patiently for it to intialize before running any scripts. Seems to have been cause by running scripts before R2025 was ready. Thank you!!
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!