How to delete values less than a given limit?

60 次查看(过去 30 天)
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.

采纳的回答

KSSV
KSSV 2020-6-10
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 个)

类别

Help CenterFile Exchange 中查找有关 Simulink Functions 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by