Filter löschen
Filter löschen

How can I change the elements to zero when they are less than specific threshold

246 Ansichten (letzte 30 Tage)
I have A = [1,10,4,8,25,80,1,4,8]
I want to put zerpo those elements which are less than 5
in fact, 5 is my threshold

Akzeptierte Antwort

Adam Danz
Adam Danz am 13 Sep. 2020
Bearbeitet: Adam Danz am 13 Sep. 2020
A(A<5) = 0;
A(A<=5) = 0;
B = A .* double(A>5);
B = A .* double(A>=5);
Try them out and choose one.
  3 Kommentare

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by