Conversion of Matrix dimensions

조회 수: 2 (최근 30일)
Fayyaz
Fayyaz 2015년 5월 17일
댓글: Star Strider 2015년 5월 17일
Hi
I have a matrix 81 by 81 i.e.
1 2 . . 81
1 a1,1 a1,2 a1,81
.
.
81 a81,1 a81,81
I need to convert it to a matrix of order 6561 (81*81) by 2 i.e.
1=a1,1
2=a1,2
. .
81=a81,81
Any help in this regard would be greatly appreciated. Thanks in advance.
  댓글 수: 4
Fayyaz
Fayyaz 2015년 5월 17일
Fayyaz
Fayyaz 2015년 5월 17일
Thanks all for your comments. Problem has been solved. :)

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

채택된 답변

Star Strider
Star Strider 2015년 5월 17일
편집: Star Strider 2015년 5월 17일
If ‘A’ is your matrix, either use the reshape function:
Av = reshape(A, [], 1);
or simply use the vector default:
Av = A(:);
EDIT — I didn’t see the repeating indices in the first column. To create them, use the repmat function:
Ix = repmat(1:81, 1, 81)';
  댓글 수: 2
Fayyaz
Fayyaz 2015년 5월 17일
Both of them are OK. thanks :)
Star Strider
Star Strider 2015년 5월 17일
My pleasure!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by