Problem with parfor loop (not enough input arguments)
6 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Swapnil Sayan Saha
2019-5-26
2 个评论
Walter Roberson
2019-5-26
Was Hd a global variable? If so then parfor would have seen it as [] in the workers, as the content of global variables is not copied to workers.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Parallel for-Loops (parfor) 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!