You can't use
c = row1;
c = [cell; row2]
because the numbers of columns in the two rows don't match. In a cell array, the number of columns has to be the same for all rows. For the same reason, you can't use this either (it would be equivalent):
c = row1;
c(end+1,:) = row2
If you need different numbers of "columns in each row" (or a "jagged array") you need two levels: use a (first-level) cell array for the rows, and in each row store a (second-level) cell array for the columns. For example:
c = {row1};
c = [c; {row2}]; %// or c(end+1) = {row2};
Now c
is a cell array of cell arrays:
c =
{1x3 cell}
{1x4 cell}
and you can use "chained" indexing like this: c{2}{4}
gives the string 'foo4'
, for example.