Borrar filtros
Borrar filtros

Row and column of numbers in matrix

3 visualizaciones (últimos 30 días)
armin m
armin m el 26 de Nov. de 2021
Comentada: armin m el 26 de Nov. de 2021
Hi. I wanna find row and column of specific number. Tnx

Respuesta aceptada

Adam Danz
Adam Danz el 26 de Nov. de 2021
Editada: Adam Danz el 26 de Nov. de 2021
[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)

Más respuestas (0)

Categorías

Más información sobre Elementary Math en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by