MATLAB freezes when running code blocks
58 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I've been experiencing problems with a MATLAB installation on a new computer. I am running R2021B on Windows 10 Pro (results from running ver are below).
Essentially everything is fine when I directly run a code in a file via for instance the "run" in the toolbar; however, whenever I try to run code either from the command window or by doing Ctrl-Enter on a code block (defined by "%%") MATLAB will freeze up, saying it is busy for several seconds, even for the most simple tasks (i.e. even running 1+1 will freeze it for several seconds). Even more weird. Oftentimes when I do Ctrl-enter on a code block, MATLAB will just sit there, doing/outputting nothing. When I then go to the command window and do anything (i.e. even just press enter), MATLAB will immediately enter this frozen busy state for several seconds before eventually outputting the result.
I saw online that a somewhat similar problem was caused by having source control on, but even with it off the same problem persists. Any advice for troubleshooting this would be greatly appreciated, as it makes for a very frustrating programming experience.
ver results (license info omitted):
MATLAB Version: 9.11.0.1769968 (R2021b)
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 19043)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
4 comentarios
Riccardo Scorretti
el 1 de Abr. de 2022
It's really weird. I suggest you to signal this bug - because if it is code independent, it is a bug. I never experienced such a problem, I'm sorry I cannot help.
Respuestas (1)
Yash Srivastava
el 5 de Abr. de 2022
Hi Adam,
You may try the following troubleshooting steps:
1. Make a copy of pathdef.m file outside of your MATLAB path which can be located by using the following command:
which -all pathdef
2. Please execute the following commands in the MATLAB Command Window to restore the default MATLAB search path and rehash the toolbox cache:
restoredefaultpath
rehash toolboxcache
3. Please use MATLAB to see if the issue occurs again. If the issue is resolved, then you may want to save the new MATLAB search path by executing the following command:
savepath
NOTE: This will remove any custom paths you may have created. The following MATLAB Answers post is an additional resource on how to back them up:
1 comentario
Ver también
Categorías
Más información sobre Startup and Shutdown en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!