How can I find index of nearest value to specific number
Mostra commenti meno recenti
Please find attached file I want to find first index of arrays < 5 and then remove them from matrix (I want to filter arrays less than 5). I really appreciate any help.
8 Commenti
Adam
il 26 Mar 2020
The question in your title is different to in the body so I'm not sure which is the one you actually mean, but
doc find
works for the one in the question body, e.g.
find( myArray < 5, 1 );
and for finding the nearest element to some value
[~, idx] = min( abs( myArray - 5 ) );
would find the value closest to 5 in myArray.
Farshid Daryabor
il 26 Mar 2020
Farshid Daryabor
il 26 Mar 2020
Akira Agata
il 26 Mar 2020
Looking at your attached data, the matrix is 143-by-417 and the 1st rows contains many >5 values.
Could you tell us more details on the problem you are facing and on what the desired output matrix looks like.
Farshid Daryabor
il 26 Mar 2020
Farshid Daryabor
il 26 Mar 2020
Adam Danz
il 26 Mar 2020
I don't see any attachments. Is this question answered?
Farshid Daryabor
il 26 Mar 2020
Risposte (0)
Categorie
Scopri di più su Creating, Deleting, and Querying Graphics Objects in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!