Clear Filters
Clear Filters

Transpose column to row

3 views (last 30 days)
Nils Pelzer
Nils Pelzer on 15 Nov 2021
Commented: Star Strider on 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 Comments
Nils Pelzer
Nils Pelzer on 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 on 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.

Sign in to comment.

Answers (0)

Categories

Find more on Data Type Identification in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!