How to rearrange data in matrix ?

1 visualizzazione (ultimi 30 giorni)
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 ?

Risposta accettata

Stephen23
Stephen23 il 18 Dic 2017
>> A = 1:15;
>> reshape(A,5,3).'
ans =
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
>>

Più risposte (0)

Categorie

Scopri di più su Matrices and Arrays in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by