Problem with parfor loop (not enough input arguments)
古いコメントを表示
I'm having problem with the following snippet of code:
parfor i = 1:196072
z = x(i,:);
z1 = filter(Hd, z);
fprintf(fid, '%20.6f', z1);
fprintf(fid, '\n');
end
fclose(fid);
As soon as I run the code snippet, it says: Not Enough Input Arguments.
However, the code works fine using normal for loop. I tried shutting down and restarting Parpool but no effect. I also tried restarting MATLAB, no effect. I tried deleting local_cluster_jobs folder in C:/Users/AppData/Roaming/MATLAB but no effect.
3 件のコメント
Rik
2019 年 5 月 26 日
Can you confirm this also fails with another loop variable? I am personally not a fan of i and j as loop variables because they can be confusing and cause weird bugs.
Another issue might be the fprintf, although that might work as intended. (note that the order of execution is not guaranteed, so the files will be different when created with for or parfor)
Walter Roberson
2019 年 5 月 26 日
Is Hd possibly a global variable?
Swapnil Sayan Saha
2019 年 5 月 26 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Data Preprocessing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!