How to find which postions in a vector has negative values and output them?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
sairohith mudduluru
el 17 de Feb. de 2018
Comentada: Stephen23
el 19 de Feb. de 2018
i have a vector and need to find the postions which has negative values
0 comentarios
Respuesta aceptada
Más respuestas (1)
Stephen23
el 17 de Feb. de 2018
find is not required, logical indexing is simpler and more efficient:
B = A(A<0)
2 comentarios
Ver también
Categorías
Más información sobre Logical 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!