MATLAB: How can to concatenate data from each column of a cell array into a row

arrayfuncatconcatenateinputseriesneural networkreshapetranspose

I have a 1×13 cell array where each column has a 1200×2 array.
I need to reorganize it to a 1×15600 with a 2×1 array in each column. In other words, 1×15600 cell array of 2×1 vectors representing two values over 1200 timesteps to use as a InputSeries of a Neural Network.
Visually, I have:
c1 c2 c13 -> column of cell array
-------------------------------------------------------
1 1.2 1.3 1.4 1.25 1.26
2 2.2 2.3 2.4 2.25 2.26
3 3.3 3.3 3.4 3.25 3.26
.
.
.
1200 1200.2 1200.3 1200.4 1200.25 1200.26
What I need:
c1 c2 c1200 c1201 c1202 c15600 -> number of columns of new cell array
------------------------------------------------------------------------
1 2 1200 1.3 2.3 1200.25
1.2 2.2 1200.2 1.4 2.4 1200.26
I tried to transpose the original cell array to have a 1×13 w/2×1200 and then concatenate each column but my code never worked as I wanted. Some commands I used: transpose, cat, reshape, arrayfun.
Thank you, Erika

Best Answer

Like this?
C = your cell array
result = mat2cell(cell2mat(cellfun(@transpose,C,'uni',false)),2,ones(1,15600));