Transposing Blocks of Rows in a Cell Array

I have a cell array that consists of both numeric and non-numeric data. I want to transpose it in a certain way. That is, I want to take the first 43 rows and transpose those first, then I want to transpose the next 43 rows and place them under the first 43 rows and so on (in total, I have a collection of 202 groups of 43 rows). So, exactly what is being done in this question here:

https://au.mathworks.com/matlabcentral/answers/73483-transposing-blocks-of-matrices-from-a-bigger-initial-matrix

I have tried the code recommended there, but because my cell array is not only numeric data, the cell2mat and mat2cell commands don't work well.

 採用された回答

Guillaume
Guillaume 2018 年 4 月 19 日

1 投票

newcellarray = num2cell(reshape(yourcellarray.', size(yourcellarray, 2), 43, []), [1 2]); 
newcellarray = vertcat(newcellarray{:})

1 件のコメント

Kenneth Mano
Kenneth Mano 2018 年 4 月 19 日
Thank you, this worked!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCell Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by