How to write multiple rows in a multiple column way without changing the order

 Réponse acceptée

result = reshape(A.',1,numel(A));

2 commentaires

Thnaks. I understand the row to column and numel operation. What is 1 for ? Number of rows ?
James Tursa
James Tursa le 4 Oct 2017
Modifié(e) : James Tursa le 4 Oct 2017
Yes, the 1 is the number of rows, and numel(A) is the number of columns. The initial transpose is to get the row elements of the original A to be next to each other in memory so they will appear next to each other after the reshape.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by