Error Variable in a parfor cannot be classified - Parfor
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Juan Saiz
il 26 Ott 2020
Risposto: Srivardhan Gadila
il 2 Nov 2020
I am trying to convert my code over to run with parfor. However there is an error "The variable KG in a parfor cannot be classified". I have search around on the website and have read people with similar problems, but none of those answers seem to fix my problem. My code is as follows. (Nnod is a number, Mnod and Melem are arrays). I appreciate the help.
Ndofs=Nnod;
KG=sparse(Ndofs,Ndofs);
FG=zeros(Ndofs,1);
parfor i=1:Nelem
Ke = Kelem(i,Mnod,Melem);
Fe = Felem(i,Mnod,Melem);
nod1 = Melem(i,2);
nod2 = Melem(i,3);
nod3 = Melem(i,4);
dofs = [nod1,nod2,nod3];
for L=1:length(dofs)
for m=1:length(dofs)
KG(dofs(L),dofs(m))=KG(dofs(L),dofs(m))+Ke(L,m);
end
FG(dofs(L))=FG(dofs(L))+Fe(L);
end
end
0 Commenti
Risposta accettata
Srivardhan Gadila
il 2 Nov 2020
The code itself displays the following warnings before executing it:
Try to fix these warnings before executing the code & then refer to the documentation of Nested for-Loops: Requirements and Limitations.
You may also refer to the relevant pages at Help Center: "The variable in a parfor cannot be classified" & already answered MATLAB Answers.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Get Started with MATLAB in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!