I m trying to use the parfor loop in the matlab parallelism package. I m having a similar problem to this guy : MATLAB parfor slicing issue? . The output matrix doesn t seem to be recognized as a sliced variable. In my specific case, I m trying to stack use other for loops inside the parfor, and I have trouble applying the solution proposed in the other thread to my problem. Here is a dummy example of what I m trying to do :
n=175;
matlabpool;
Matred=zeros(n,n);
Matx2Cell = cell(n);
parfor i=1:n
for j=1:n
for k=1:n
Matred(j,k)=exp((j+i+k)/500)
end;
end;
Matx2Cell{i}=Matred;
end;
matlabpool close;
P.S.,我知道,它将努力将 par子放在 k上,而不是一lo。 但是,我仍然想把它放在一路上(我认为,在我的真正方案中,这样做会更具有时间效率)。
Thanks a lot Frédéric Godin