I am tempted to reshape matrix A into smaller matrix and then reverse it, but I don't want to do that as I expect my matrix A to become multidimensional when I collect more data.
Reversing an array within smaller subsets
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Murtaza Mohammadi
am 15 Nov. 2022
Kommentiert: Murtaza Mohammadi
am 15 Nov. 2022
Hello
I have a long array with 60 datapoints, say A = [1 2 3 4.....58 59 60]. I want to reverse in a subgroup of 5 elements, i.e. B = [5 4 3 2 1 10 9 8 7 6 15 14 13 12 11........60 59 58 57 56]. In fact a general solution can be handy, where an array with M elemnts need to flipped in N sized subsets.
Thank you
2 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices 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!