How to extract certain values from an array

조회 수: 113 (최근 30일)
Lama Shalabi
Lama Shalabi 2021년 3월 26일
댓글: Lama Shalabi 2021년 3월 26일
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!

채택된 답변

per isakson
per isakson 2021년 3월 26일
>> x=[8,5,5,5,9,4,3,2,9,10];
>> new = x(x<7)
new =
5 5 5 4 3 2

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by