MATLAB: Dynamic naming using eval(.)

evalmatrix manipulation

I am creating new matrices in a loop
IP = IP_count(:);
x=IP_count_length;
for i=1:IP_count_length
eval(['FBSeq' num2str(i) '_Table' '=BinaryCombination(IP(i))'])
end
//FBSeq1_Table;
//FBSeq2_Table;
.
.
.
//FBSeqx_Table
% Binary combination function just computes all possible binary combinations of length (IP(i))
These matrices are of different dimensions. Now I want to pass these newly created matrices to a function.
How can I do this task. Moreover how can I perform processing of particular row/col of any of these matrices later on. Since I have used dynamic naming of these matrices , I dont know how can I call them

Best Answer

I would advise using a cell array instead. E.g.,
IP = IP_count(:);
x = IP_count_length;
FB = cell(1,IP_count_length);
for i=1:IP_count_length
FB{i} = BinaryCombination(IP(i));
end
Then you can just pass FB to your function.