I'd like to use a parfor loop instead of a for loop in some code I have written. I currently call a function within a for loop to which I input a structure 'photon'. However, I would only like to input certain entries from the fields within this structure: e.g.
parfor bin = 1:numel(s_uniq)
s_crnt = s_uniq(bin);
photon_crnt.W = photon.W(s_int==s_crnt);
MLint tells me I cannot use 'photon' in this way and that I should slice it. I have tried to do this but continue getting this message.
I'd appreciate your help.