Set elements in a 3D array to zero based on a condition

1 Ansicht (letzte 30 Tage)
KCE
KCE am 9 Aug. 2022
Beantwortet: Matt J am 9 Aug. 2022
Hello,
I am trying to set all entries in a 3D array that are less than 0 to be equal to 0. My variable Qr is 199x199x50.
I tried this with no success:
Qr(Qr<0)==0

Akzeptierte Antwort

Matt J
Matt J am 9 Aug. 2022
Qr(Qr<0)=0;

Weitere Antworten (1)

Matt J
Matt J am 9 Aug. 2022
Qr=max(Qr,0);

Kategorien

Mehr zu Data Types finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by