Hi, I'm a new to parallel computing and was wondering if there is any way around to use parfor in my nested for-loop
for l=1:size(xSample,2) for m=1:size(ySample,2) for n=1:size(zSample,2) shiftedDoseDist=imtranslate(doseDist,[xSample(l),ySample(m),zSample(n)]); %%3D image translation
dose=shiftedDoseDist(index); TCP_n(n)=function(dose) %%function I'm calculating
end TCP_m(m)=1/sum(zWeighting)*dot(zWeighting,TCP_n); end TCP_l(l)=1/sum(yWeighting)*dot(yWeighting,TCP_m);end
I'm evaluating a function for each x,y,z translation of a 3D matrix and then doing weighted sum for normalisation (expectation value). I tried just replacing for with parfor for the outerloop and it comes up with an error that the way TCP_n,TCP_l…are defined it is not possible.
Any help would be appreciated!
Best Answer