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{:})

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Cell Arrays에 대해 자세히 알아보기

질문:

2018년 4월 19일

댓글:

2018년 4월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by