Transpose column to row

4 Ansichten (letzte 30 Tage)
Nils Pelzer
Nils Pelzer am 15 Nov. 2021
Kommentiert: Star Strider am 18 Nov. 2021
Hi Guys,
I have a problem. I have a 2 column table with 4200000 rows and want to transpose this. The thing is column 2 of my table each has a different value (double). Column 1 is from line 1 to 168(thats because there are 168 hours a week, and each name has a value for one hour of the week) the same name (thats because there are 168 hours a week, and each name has a value for one hour of the week), column 169 to 336 the same name, and so on. I want to transpose this table, so i have the name in the first column and then 1 column should be for each hour. So in conclusion the number of rows is the number of different names, and the number of columns is the number of hours plus the first column in which the different names should stand.
Can somebody explain to me how that could be done? I´m sorry, i´m still learning, so if this is just a simple trick please dont judge me.
appreciate your help!
Greetings Nils
  2 Kommentare
Nils Pelzer
Nils Pelzer am 18 Nov. 2021
I solved my Problem. It was pretty easy, i used the reshape function and after that i just transposed the matrix. But thank you very much for your help!
I appreciate it.
Greetings Nils
Star Strider
Star Strider am 18 Nov. 2021
I did not have the matrix to work with, only a description.
I almost always delete my un-accepted Answers, and have done so here as well.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Produkte


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by