How to select a range of data in matrix

21 vues (au cours des 30 derniers jours)
Austin Ukpebor
Austin Ukpebor le 13 Jan 2021
Commenté : Austin Ukpebor le 13 Jan 2021
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

Réponse acceptée

KSSV
KSSV le 13 Jan 2021
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 commentaire
Austin Ukpebor
Austin Ukpebor le 13 Jan 2021
Thanks KSSV. It works!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by