Seperating columns into rows
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Darrien Walters
am 22 Okt. 2020
Kommentiert: Ameer Hamza
am 22 Okt. 2020
I have an array consisting of 1 column and multiple rows.
eg. B=(1:10);
i would like to make an array A which contains rows of every 2 numbers in B.
So array A would look like A = [1 3 5 7 9 ; 2 4 6 8 10];
A =
1 3 5 7 9
2 4 6 8 10
I am working with an extremely large data set that I am trying to segment. My first thought was using a for loop is this possible and if so how would I go about doing it?
0 Kommentare
Akzeptierte Antwort
Ameer Hamza
am 22 Okt. 2020
Bearbeitet: Ameer Hamza
am 22 Okt. 2020
Use reshape()
B = 1:10;
A = reshape(B, 2, [])
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!