How to put each group of cells in the same row ?

5 次查看(过去 30 天)
Hello,
Let we have a cell array A of size (1*5216), I want to put each 16 cell in the same row. So how can I do that ?

采纳的回答

Guillaume
Guillaume 2019-2-11
reshape(A, 16, [])'
reshapes your cell array in columns of 16 rows (since matlab is column major). Then transpose to have rows of 16 columns.
That's assuming you want to preserve the ordering, otherwise
reshape(A, [], 16)
which directly reshape in rows of 16 columns.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by