MATLAB: For loop – splitting data

for looploop

I shall try to explain clearly, again.
I have a cell array:
Fish2 = Data{1,10,6};
I want to create a loop that will form the following groups:
Fish2_1 = Data{1,3,1};
Fish2_2 = Data{1,3,2};
I started with something like this:
C = 1:size(Fish2,3);
for i = 1:c
Fish2_i = Data(1,3,i);
end
This is obviously not operating the way i would like it to. I was hoping i would get 6 outputs, following the same pattern as the first coded sequence above.
I hope this is clear enough.
Thank you in advance.

Best Answer

you have to do an eval.
eval(['Fish2_', num2str(i), ' = Data(1,3,i);'])
instead of
Fish2_i = Data(1,3,i);