How can I delete values below certain treshold in vector

I have a 3521x1 vector and I would like to drop all values above the value of 10. How can I do this?

 Respuesta aceptada

Pawel Jastrzebski
Pawel Jastrzebski el 11 de En. de 2018
Editada: Pawel Jastrzebski el 11 de En. de 2018
vector = randi(20,1,352);
newVector = vector(vector<10);

2 comentarios

Alternatively:
vector(vector <= 10) = [];
Thanks guys!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by