Combine a cell array of cell arrays to a single cell array

조회 수: 38 (최근 30일)
Elakkiya Prakasam
Elakkiya Prakasam 2017년 7월 13일
답변: Ariel Cabello 2019년 5월 22일
Hi,
I have a dynamic cell array of cell arrays of strings and I want to combine it into a single cell array of strings.
Example: Columns 1 through 4
{4x1 cell} {9x1 cell} {8x1 cell} {10x1 cell}
I want to concatenate and the result in one cell array as
{31x1 cell}.
How to concatenate into one cell Array?

채택된 답변

Walter Roberson
Walter Roberson 2017년 7월 13일
NewCellArray = vertcat( ExistingCellArray{:} );

추가 답변 (1개)

Ariel Cabello
Ariel Cabello 2019년 5월 22일
Another way:
NewCellArray = [ OldCellArray{:} ];
Regards

카테고리

Help CenterFile Exchange에서 Numeric Types에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by