Pregunta

Suppose I have a 3x1 cell array:

c = {[1, 2, 3]; [1, 2, 3, 4, 5]; [1, 2]}

I now want to add another array, to make it a 4x1 array. How do I do this? I have tried the following:

c = {c; [1, 2, 3, 4]}

But it then tells me that:

c = {3x1 cell}    [1x3 double]

Whereas I want:

c = {4x1 cell}

What should I do? Thanks.

¿Fue útil?

Solución

c=[c; [1, 2, 3, 4]]

or

c{end+1}= [1, 2, 3, 4]
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top