Problem with parfor loop (not enough input arguments)
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Swapnil Sayan Saha
le 25 Mai 2019
Commenté : Swapnil Sayan Saha
le 5 Juin 2019
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 commentaires
Réponse acceptée
Swapnil Sayan Saha
le 26 Mai 2019
2 commentaires
Walter Roberson
le 26 Mai 2019
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.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Parallel for-Loops (parfor) dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!