Conversion of Matrix dimensions

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 件のコメント

Image Analyst
Image Analyst 2015 年 5 月 17 日
I don't know what that means. Please give a small example, like a 4 by 4 with actual numbers of the input array and desired output array.
Stephen23
Stephen23 2015 年 5 月 17 日
The first matrix has 6561 elements, the output one is shown with 81 elements. What happens to the rest of them?
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 日

1 投票

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 件)

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

質問済み:

2015 年 5 月 17 日

コメント済み:

2015 年 5 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by