Flip a matrix from 31 x 1000 to 1000 x 31 and retain same order of elements
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Mak Dukan
am 12 Okt. 2021
Kommentiert: Mak Dukan
am 12 Okt. 2021
Hi!
I have created a 31 x 1000 matrix. The 31 are years from 2020 to 2050, while the 1000 are different simulation outcomes. I will export this to Excel where my years are ordered horizontally, and the outcomes of the simulation vertically. Therefore I need the outcome to be 1000 x 31. How can I flip the matrix so that I achieve this? The elements need to follow each other exactely, because they represent yearly revenues.
Thanks,
Mak
0 Kommentare
Akzeptierte Antwort
Kevin Holly
am 12 Okt. 2021
You can tranpose the matrix with a '
matrix = rand(3,10)
matrix_transposed = matrix'
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrices and Arrays 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!