How can i classified the variable inside of the parfor loop?
Show older comments
Sir, This is my PARFOR loop coding. I can't classified some variables in PARFOR LOOP.
parfor i1=1:1:nrr1
disp(i1);
if (varran(i1) < threshold)
labe(i1)=0;
mvqcoder(i1)=[meanranr(i1)];
mvqcodeg(i1)=[meanrang(i1)];
mvqcodeb(i1)=[meanranb(i1)];
% e=e+1;
else
labe(i1)=1;
[domr]=domsearch(rang1r(i1,:),dompoolr,gsize,ci1r(i1),ci2r(i1),ci3r(i1),msr(i1),mdr,cd1r,cd2r,cd3r,mscr);
[domg]=domsearch(rang1g(i1,:),dompoolg,gsize,ci1g(i1),ci2g(i1),ci3g(i1),msg(i1),mdg,cd1g,cd2g,cd3g,mscg);
[domb]=domsearch(rang1b(i1,:),dompoolb,gsize,ci1b(i1),ci2b(i1),ci3b(i1),msb(i1),mdb,cd1b,cd2b,cd3b,mscb);
dom=[domr,domg,domb];
[rz cz]=size(dom);
meanrar=mean(rang1r(i1,:));
meanrag=mean(rang1g(i1,:));
meanrab=mean(rang1b(i1,:));
dompolr=iCalc(dompoolr,dom,cz);
dompolg=iCalc(dompoolg,dom,cz);
dompolb=iCalc(dompoolb,dom,cz);
[isomer alphr meanrr dom1r errr]=affwerrqt(rang1r(i1,:),dompolr(1:cz,:),gsize);
[isomeg alphg meanrg dom1g errg]=affwerrqt(rang1g(i1,:),dompolg(1:cz,:),gsize);
[isomeb alphb meanrb dom1b errb]=affwerrqt(rang1b(i1,:),dompolb(1:cz,:),gsize);
cdom1r(i1)=dom(dom1r);
isome1r(i1)=isomer;
alph1r(i1)=alphr;
meanr1r(i1)=meanrar;
cdom1g(i1)=dom(dom1g);
isome1g(i1)=isomeg;
alph1g(i1)=alphg;
meanr1g(i1)=meanrag;
cdom1b(i1)=dom(dom1b);
isome1b(i1)=isomeb;
alph1b(i1)=alphb;
meanr1b(i1)=meanrab;
vqcode3r(i1,:)=[isome1r(i1),alph1r(i1),meanr1r(i1),cdom1r(i1)];
vqcode3g(i1,:)=[isome1g(i1),alph1g(i1),meanr1g(i1),cdom1g(i1)];
vqcode3b(i1,:)=[isome1b(i1),alph1b(i1),meanr1b(i1),cdom1b(i1)];
% c=c+1;
end
% w1=w1+1;
end
I got Error result
The temporary variable meanrar is used after the PARFOR loop but its value is non deterministic.
The temporary variable meanrag is used after the PARFOR loop but its value is non deterministic.
The temporary variable meanrab is used after the PARFOR loop but its value is non deterministic.
then,
The PARFOR loop can't run due to the way variable dompolr is used.
The PARFOR loop can't run due to the way variable dompolg is used.
The PARFOR loop can't run due to the way variable dompolb is used.
Please any one help this problem for parfor loop.
thank you
4 Comments
Walter Roberson
on 28 Jan 2013
The problem is with code you have after this loop: you refer to meanrar, meanrag, and meanrab after the loop.
PRIYANGA
on 30 Jan 2013
Randy Souza
on 12 Feb 2013
I have restored the original text of this question.
PRIYANGA, this question has a clear subject and an accepted answer, so it may be valuable to someone else in the future. If you have a good reason why it should be removed from MATLAB Answers, please flag the question, explain why it should be deleted, and an administrator or high-reputation contributor will consider deleting the question. Please do not simply edit your question away.
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!