Convert from Rows to Column in Matlab

조회 수: 1 (최근 30일)
dau
dau 2013년 11월 25일
답변: ilker sahin 2021년 5월 8일
I wanted to convert a table data as: 24 hours (24 column), and 30 day (31 rows) become 1 column which with continue hours from 1-24 for the first day and for the second day so on.`
day/hours: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
1 A B C ........................................................
2 A'B'C'.....
...
31
Become
________________
day1/1hour A
day1/2hour B
day1/3hour C
..........
day2/1hour A'
day2/2hour B'
....
day31/1hour A'''
day31/2hour B'''
day31/24hour Z''''
  댓글 수: 2
Roger Stafford
Roger Stafford 2013년 11월 25일
Hey, no fair asking the same question twice, Dau. It wastes our time when we inadvertently duplicate answers, as I just did here.
Andrei Bobrov
Andrei Bobrov 2013년 11월 25일
I deleted duplicate of question

댓글을 달려면 로그인하십시오.

답변 (2개)

Roger Stafford
Roger Stafford 2013년 11월 25일
If these values A, B, C, etc. as shown are in a 31 x 24 matrix called Mat1, then do:
Mat2 = reshape(Mat1',[],1);
  댓글 수: 1
dau
dau 2013년 11월 25일
Thank you Roger very much !

댓글을 달려면 로그인하십시오.


ilker sahin
ilker sahin 2021년 5월 8일
Change the places between the first row and third column elements of matrix A. How can I do this?

카테고리

Help CenterFile Exchange에서 Numeric Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by