Transpose column to row

3 次查看(过去 30 天)
Nils Pelzer
Nils Pelzer 2021-11-15
评论: Star Strider 2021-11-18
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 个评论
Nils Pelzer
Nils Pelzer 2021-11-18
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 2021-11-18
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.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Type Identification 的更多信息

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by