MATLAB freezes when running code blocks
조회 수: 56 (최근 30일)
이전 댓글 표시
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
Riccardo Scorretti
2022년 4월 1일
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.
답변 (1개)
Yash Srivastava
2022년 4월 5일
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:
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!