필터 지우기
필터 지우기

How to select element of an array between two values?

조회 수: 46 (최근 30일)
Martha
Martha 2014년 3월 24일
댓글: FSh 2021년 7월 17일
Hi,
I have an array of 2800 elements < 2800 x 1 double >, and I want to create a new array only with the values that are greater than -0.15 and less than 0.15. Many Thanks in advance.
Regards, Martha

채택된 답변

Walter Roberson
Walter Roberson 2014년 3월 24일
A(A > -0.15 & A < 0.15)
or
A(abs(A) < 0.15)
  댓글 수: 4
Martha
Martha 2014년 3월 24일
My apologies Walter, I tried again and it works perfectly. Thank you very much!
FSh
FSh 2021년 7월 17일
strange it does not work for me ??!!!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Martha
Martha 2014년 3월 24일
Thanks Walter,
Both work very well! Do you know also how to do the same but with several columns?, That is, having < 2800 x 3 > but analyzing only values from the first column and return the values from the given rows but all the columns.
Thanks
Martha

카테고리

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