storing indices of some entries in a matrix

1 visualización (últimos 30 días)
R yan
R yan el 20 de Abr. de 2014
Editada: Mischa Kim el 20 de Abr. de 2014
I want to store the index of all the entries with value 5 in a matrix. is there an inbuilt function for it.

Respuestas (1)

Mischa Kim
Mischa Kim el 20 de Abr. de 2014
Editada: Mischa Kim el 20 de Abr. de 2014
Ryan, use
[r c] = find(data==5)
r and c are the row and column indices of all data entries equal to 5.

Categorías

Más información sobre Data Types en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by