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

1 回表示 (過去 30 日間)
KCE
KCE 2022 年 8 月 9 日
回答済み: Matt J 2022 年 8 月 9 日
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

採用された回答

Matt J
Matt J 2022 年 8 月 9 日
Qr(Qr<0)=0;

その他の回答 (1 件)

Matt J
Matt J 2022 年 8 月 9 日
Qr=max(Qr,0);

カテゴリ

Help Center および File ExchangeData Types についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by