Transpose column to row

조회 수: 5 (최근 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에서 Logical에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by