Remove elements > 0 and < -1 from an array and replace them by 0

7 ビュー (過去 30 日間)
FL
FL 2018 年 11 月 7 日
コメント済み: madhan ravi 2018 年 11 月 7 日
Hi, I have an array (7x269), as attached. I would like to remove all values (elements) >0 and <-1 and replace them by 0. Thanks

採用された回答

madhan ravi
madhan ravi 2018 年 11 月 7 日
編集済み: madhan ravi 2018 年 11 月 7 日
load data.mat
offsetfromPPT(offsetfromPPT<-1 | offsetfromPPT>0)=0
max(max(offsetfromPPT)) %if it is zero
min(min(offsetfromPPT)) %if it is less than -1 then the solution is right
  4 件のコメント
FL
FL 2018 年 11 月 7 日
It worked. Thank you
madhan ravi
madhan ravi 2018 年 11 月 7 日
Anytime :)

サインインしてコメントする。

その他の回答 (0 件)

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by