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.

 采纳的回答

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

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Numeric Types 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by