How do I get index matrix for matrix of values?
1 回表示 (過去 30 日間)
古いコメントを表示
hi, can anyone one help me
if i have matrix A i want get index matrix for matrix A
A=[9 5 1
6 5 7
8 4 11]
for exmple The result
A_index =11 12 13
21 22 23
31 32 33
4 件のコメント
Fangjun Jiang
2021 年 3 月 5 日
編集済み: Fangjun Jiang
2021 年 3 月 5 日
It looks like
Row 1 Column 1, Row 1 Column 2, Row 1 Column 3
Row 2 Column 1, Row 2 Column 2, Row 2 Column 3
I don't know what is the meaning, purpose or usefulnesss for this
採用された回答
Cris LaPierre
2021 年 3 月 5 日
編集済み: Cris LaPierre
2021 年 3 月 5 日
Now I'm confused, too. You've now posted two completely different types of index matrices. Perhaps instead, could you explain how A maps to A_index?
A_index =11 12 13
21 22 23
31 32 33
As for the current A_index, you can take advantage of implicit expansion to create it.
A_index = (10:10:30)' + (1:3)
その他の回答 (1 件)
Fangjun Jiang
2021 年 3 月 5 日
編集済み: Fangjun Jiang
2021 年 3 月 5 日
>> [Row,Column]=ind2sub([3,3],1:9)
Row =
1 2 3 1 2 3 1 2 3
Column =
1 1 1 2 2 2 3 3 3
>> [Row,Column]=ind2sub([11,11],[10,11,12, 109,110,111])
Row =
10 11 1 10 11 1
Column =
1 1 2 10 10 11
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Operators and Elementary Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!