How to extract certain values from an array

I have an array:
x=[8,5,5,5,9,4,3,2,9,10]
I would like to create a new array but only with values less than 7. How can I do this?
Thank you in advance!

 Respuesta aceptada

per isakson
per isakson el 26 de Mzo. de 2021
>> x=[8,5,5,5,9,4,3,2,9,10];
>> new = x(x<7)
new =
5 5 5 4 3 2

Más respuestas (0)

Categorías

Más información sobre Operators and Elementary Operations en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 26 de Mzo. de 2021

Comentada:

el 26 de Mzo. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by