How to check a number is in a array or not?
Mostrar comentarios más antiguos
a=[8 9 6 5 3], I want to know 5 is there or not.
Respuesta aceptada
Más respuestas (1)
sum(a==5) > 0
any(a==5)
Categorías
Más información sobre Operators and Elementary Operations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!