Finding first value in an array equal to each number in a vector
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
L'O.G.
el 22 de Abr. de 2023
Comentada: L'O.G.
el 22 de Abr. de 2023
I can find the first value in test_array that is equal to 2 using the following:
find(test_array==2, 1, 'first')
But how do I find the first value in test_array that is equal to, say, a vector of values? So the first value, for example, that is equal to 3, the first value that is equal to 5, the first value that is equal to 7, etc.?
0 comentarios
Respuesta aceptada
Walter Roberson
el 22 de Abr. de 2023
See the second output of ismember() -- you might need to exchange the parameters
Más respuestas (0)
Ver también
Categorías
Más información sobre Get Started with MATLAB 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!