3

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 the inner cells, and the result be one cell array of the form

{31x1 cell}.

How can I concatenate into one cell array without for loop?

Thanks

1 Answer 1

3

Using vertcat...

cellarr = {cell(4,1), cell(9,1), cell(8,1), cell(10,1)};
merged = vertcat(cellarr{:});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.