find value with row and column

1 次查看(过去 30 天)
Álvaro
Álvaro 2023-2-20
回答: Voss 2023-2-20
Hi
i need find value in matrix corresponding with row and column.

回答(1 个)

Voss
Voss 2023-2-20
matrix = magic(4)
matrix = 4×4
16 2 3 13 5 11 10 8 9 7 6 12 4 14 15 1
value = 10
value = 10
[row,column] = find(matrix == value)
row = 2
column = 3

类别

Help CenterFile Exchange 中查找有关 NaNs 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by