How to merge cell (100 x 3) of arrays into a single cell (100 x 1) by concatenating the arrays ?

1 Ansicht (letzte 30 Tage)
I have a cell 100 x 3 where and cells(1,:) each contain an array 35x1. How do I convert this to a cell of 100 x 1 where the first cell would now contain an array 35x3 ?

Akzeptierte Antwort

Stephen23
Stephen23 am 17 Jan. 2017
Bearbeitet: Stephen23 am 17 Jan. 2017
Where X is the input cell array of size N*3:
cellfun(@(a,b,c)horzcat(a,b,c),X(:,1),X(:,2),X(:,3),'UniformOutput',false)

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by