How can to concatenate data from each column of a cell array into a row?
    2 ビュー (過去 30 日間)
  
       古いコメントを表示
    
I have a 1x13 cell array where each column has a 1200x2 array.
I need to reorganize it to a 1x15600 with a 2x1 array in each column. In other words, 1x15600 cell array of 2x1 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 1x13 w/2x1200 and then concatenate each column but my code never worked as I wanted. Some commands I used: transpose, cat, reshape, arrayfun.
Thank you, Erika
0 件のコメント
採用された回答
  James Tursa
      
      
 2016 年 10 月 26 日
        
      編集済み: James Tursa
      
      
 2016 年 10 月 26 日
  
      Like this?
C = your cell array
result = mat2cell(cell2mat(cellfun(@transpose,C,'uni',false)),2,ones(1,15600));
その他の回答 (0 件)
参考
カテゴリ
				Help Center および File Exchange で Deep Learning Toolbox についてさらに検索
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

