How to delete values less than a given limit?
59 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Danny Maefengea
am 10 Jun. 2020
Beantwortet: KSSV
am 10 Jun. 2020
Here's the question set up.
Create a 1 x 10 vector K with random values ranged 0-5.
Find a way to delete all the elements in K that are less than 2.5.
0 Kommentare
Akzeptierte Antwort
KSSV
am 10 Jun. 2020
If K is your 1*10 vector.
V(V<2.5) = [] ; % this removes all elements less then 2.5
V(V<2.5) = NaN ; % This will replace all elements less then 2.5 with NaNs
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Simulink Functions finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!