every for loop never stops running
古いコメントを表示
While trying to write a code for SVM classification, I noticed that once I get to the for loop to loop through subfolders to obtain files sequentially, the loop nevers tops running until I shut down my matlab. I have tried running other for loops from old codes that used to run and the same thing: e.g
for s = 1:length(nsubs).
I've uninstalled my MATLAB version 2020b and installed version 2022a. still, the same thing. I have tried clearing my RAM and installed an antivirus for fast performance, still, the for loops won't stop running. Every other preceeding lines of code runs until it gets to the for loop, then it never stops running. What can I do ?
I am using a windows 10 laptop.
8 件のコメント
KSSV
2022 年 7 月 27 日
Show us the code which is troubling you.
Walter Roberson
2022 年 7 月 27 日
Also, please show us the output for
which length(nsubs)
Monalisa Chikezie
2022 年 7 月 27 日
編集済み: Monalisa Chikezie
2022 年 7 月 30 日
Monalisa Chikezie
2022 年 7 月 27 日
編集済み: Jan
2022 年 7 月 28 日
Walter Roberson
2022 年 7 月 27 日
SPM has a compatibility directory that duplicates some matlab functions, interfering with proper use of matlab. You need to delete that compatibility directory.
Monalisa Chikezie
2022 年 7 月 27 日
Walter Roberson
2022 年 7 月 28 日
spm12/external/fieldtrip/compat/matlablt2010b and I seem to recall that there is also a directory there for r2013
Note:
pwd = GLM_dir;
It is a bad idea to shadow the function pwd by a variable. Maybe you mean:
cd(GLM_dir);
The posted code does not contain any user-defined functions of functions of external toolboxes. All you do is loading files. So set a breakpoint in the profiler and step through the code line by line. Findout, in which command the processing is stalled. Stop and restart Matlab. The next time set a breakpoint in the failing line and step into this command until you find the command, which is responsible for the problem. It might contain an infinite loop.
Where does Matlab stop if you press Ctrl-C during the code runs "forever"? Is this reproducibly the same command?
Do you use external toolboxes? If so, which one?
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!