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
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
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)
A_index = 3×3
11 12 13 21 22 23 31 32 33
  6 个评论
Cris LaPierre
Cris LaPierre 2021-3-5
I'm trying to build inverse matrix
Have you tried the inv function?
sarah
sarah 2021-3-5
A_index = (10:10:160)' + (1:16)
i think it is better to convert the values to hexadecimal so that there is no duplication

请先登录,再进行评论。

更多回答(1 个)

Fangjun Jiang
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

类别

Help CenterFile Exchange 中查找有关 Operators and Elementary Operations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by