MATLAB: Create a new table based on cell array

arraycell

Hi,
Is there a better way to create the table below (Its a new table consist of id number and cell array data)?
Thanks.
cData=[;];
for i = 1 : length(cellarray)
objectNumber=i;
currentObject=cellarray{i};
newDataRow = {objectNumber, currentObject};
cData=[cData;newDataRow];
disp(cData);
end

Best Answer

Yes
dataId = num2cell( 1:numel( cellarray )).' ;
cData = [dataId, cellarray] ;