How to select a range of data in matrix

조회 수: 19(최근 30일)
Austin Ukpebor
Austin Ukpebor 2021년 1월 13일
댓글: Austin Ukpebor 2021년 1월 13일
I have a column matrix (10608x1) with a minimum value of 38.8 and maximum value of 192.8. I want to retain the matrix with the range of minimum values to a certain number say 44.1. Please I need a help to achieve this. Thanks

채택된 답변

KSSV 2021년 1월 13일
Let A be your column matrix.
idx = A <= 44.1 ; % get indices using logical indexing
iwant = A(idx) ; % Extract those elements
Read about logical indexing of arrays in MATLAB.
  댓글 수: 1
Austin Ukpebor
Austin Ukpebor 2021년 1월 13일
Thanks KSSV. It works!

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

추가 답변(0개)


Find more on Matrices and Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by