A couple of things to point out.
It is always best not to use i and j to index loops, these are both reserved for imaginary numbers.
The example you have given us is trivial and can be done without any loop at all - the loop over i isn't even used. For the point below, it would be really useful to know the details of what you are trying to implement. That way you will get the best possible answer.
What you will need to do is use a temporary variable in the j-loop. This will then assigned to your primary variable indexed in the i-loop. For example....
My_Output = NaN(20,10);
parfor ii = 1:10
Temporary_Var = NaN(20,1);
for jj = 1:20
Temporary_Var(jj) = some_function();
My_Output(:,ii) = Temporary_Var;