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

6 vues (au cours des 30 derniers jours)
Sarah A
Sarah A le 11 Fév 2019
Commenté : Sarah A le 11 Fév 2019
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 ?

Réponse acceptée

Guillaume
Guillaume le 11 Fév 2019
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.

Plus de réponses (0)

Catégories

En savoir plus sur Resizing and Reshaping Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by