I'm trying to parallelize the following code:
for m = 1:t
dR((m-1)*3+1) = temp1(m);
dR((m-1)*3+2) = temp2(m);
dR(m*3) = temp3(m);
end
temp1, temp2, temp3 are just vecoters with size of m X 1. The size of dR is 3m X 3m.
Whenever I use parfor instead of for, it the code indicate errors in dR. I am not sure why. Please give me some suggestions.
Thank you!