In MATLAB, the first set of loops below accounts for duplicates, but the second set of loops (using PARFOR) does not. They overwrite the previous value. How do we fix that?
For loop:
for d = 1:length(set),
for k = 1:length(dset),
if strcmp(pset(k),set(d)),
t(h,p) = dset(k);
h = h+1;
end
end
end
PARFOR loop:
parfor d = 1:length(set),
for k = 1:length(dset),
if strcmp(pset(k),set(d)),
t(d) = dset(k);
end
end
end