I want to create a cell array, where each row is an array of strings. The rows are of different lengths. Suppose that I have these rows stored as cells themselves, e.g.:
row1 = {'foo1', 'foo2', 'foo3'}
row2 = {'foo1', 'foo2', 'foo3', 'foo4'}
row3 = {'foo1', 'foo2'}
How do I concatenate these into one cell? Something like this:
cell = row1
cell = [cell; row2]
cell = [cell; row3]
But this gives me an error:
Error using vertcat. Dimensions of matrices being concatenated are not consistent.
I want to do this in a loop, such that on each interation, another row is added to the cell.
How can I do this? Thanks.