Find indices of column/row in double that have matching value

17 visualizaciones (últimos 30 días)
a = 5.786
b = 14x308 double (all cells contain numerical values)
Assuming there is one cell in 'b' with a value that matches 'a' exactly - how do I found the column/row indices in b of this matching cell?

Respuesta aceptada

the cyclist
the cyclist el 5 de Mayo de 2021
Editada: the cyclist el 5 de Mayo de 2021
Sounds like you could use either the find or ismember command.
  1 comentario
DavidL88
DavidL88 el 5 de Mayo de 2021
Thanks that worked! I had tried using find with ismember or intersect but hadn't worked. Just used [c latency] = find(a == b); and that worked.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Logical 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