Row and column of numbers in matrix

2 次查看(过去 30 天)
Hi. I wanna find row and column of specific number. Tnx

采纳的回答

Adam Danz
Adam Danz 2021-11-26
编辑:Adam Danz 2021-11-26
[rowNum, colNum] = find(matrix == value)
Or, if you're working with floating point decimals,
[~, minIdx] = min(abs(matrix - value));
[rowNum, colNum] = ind2sub(size(matrix), minIdx)

更多回答(0 个)

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by