I want to find the least negative non positive number in a vector
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Aidan
el 9 de Mzo. de 2024
Comentada: Star Strider
el 10 de Mzo. de 2024
If I had a set like
[-10 , -5 , -1 , -0.1 , 0 , 1 , 2 , 3 , 4 , 5]
How could I write something to find -0.1 and print out its postion in the set. I want to find the highest value negitive number in a set.
1 comentario
Respuesta aceptada
Star Strider
el 10 de Mzo. de 2024
Perhaps this —
V = [-10 , -5 , -1 , -0.1 , 0 , 1 , 2 , 3 , 4 , 5]
[Vmax,idx] = max(V(V<0))
V(idx)
.
2 comentarios
Más respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!