It is not recommended practive to put your tables as array type, highly error prone and variable name changes. Your should assign as
subtable(:, i) = data(x, :) % for each iteration height of the table must match
It is recommended to use cell array as
subtable{i}= data(x, :) ;
