문제

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.

도움이 되었습니까?

해결책

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

or

c{end+1}= [1, 2, 3, 4]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top