It looks like parfor sends one variable to each parallel operation, meaning that the variable references must be clear to begin with.
I.e. Z(i) = #, Z(i,j) = #, and Z(i,j,k) = # are valid but Z(i + j) is not valid.
So, that leaves you with two choices, that I know of.
1. Calculate Z as a 2x2x3 matrix
Z = zeros([2,2,3]);
Now, you have a 2x2x3 matrix that you would need to deference into a vector using tools such as repmat or loops.
2. calculate z as a vector
The other option is to have a single Parallel loop and d3ereference the index's that you want within the loop. An example follows.
Z = zeros(1,12);
parfor i = 1:12
l = mod(i,3);
if(l == 0);
l = 3;
j = floor( ( i -l) / 6);
k = floor( ( i - l - j) / 3);
Z( i) = sum(Y(:,l)+j*k)
This leaves you with your desired Z vector. However, the inner loop calculations are messier.