parfor i = 1:n
  A(i) = sin(i*2*pi/n);
end

y = distributed.zeros(1,nslots);
spmd
  y(labindex) = labindex;
end
y = gather(y);

