Effacer les filtres
Effacer les filtres

How to rearrange data in matrix ?

1 vue (au cours des 30 derniers jours)
Pradya Panyainkaew
Pradya Panyainkaew le 18 Déc 2017
if I have A=[1:15].
After that, I want to rearrange matrix A to get a result: MyResult=[1 2 3 4 5; 6 7 8 9 10; 11 12 13 14 15];
How can I code to get the result like this ?

Réponse acceptée

Stephen23
Stephen23 le 18 Déc 2017
>> A = 1:15;
>> reshape(A,5,3).'
ans =
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
>>
  1 commentaire
Pradya Panyainkaew
Pradya Panyainkaew le 18 Déc 2017
Thank you so much...Stephen Cobeldick..^_^

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays 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