How to extract certain values from an array

10 Ansichten (letzte 30 Tage)
Lama Shalabi
Lama Shalabi am 26 Mär. 2021
Kommentiert: Lama Shalabi am 26 Mär. 2021
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!

Akzeptierte Antwort

per isakson
per isakson am 26 Mär. 2021
>> x=[8,5,5,5,9,4,3,2,9,10];
>> new = x(x<7)
new =
5 5 5 4 3 2

Weitere Antworten (0)

Kategorien

Mehr zu Operators and Elementary Operations finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by