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

6 vues (au cours des 30 derniers jours)
FL
FL le 7 Nov 2018
Commenté : madhan ravi le 7 Nov 2018
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

Réponse acceptée

madhan ravi
madhan ravi le 7 Nov 2018
Modifié(e) : madhan ravi le 7 Nov 2018
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 commentaires
FL
FL le 7 Nov 2018
It worked. Thank you
madhan ravi
madhan ravi le 7 Nov 2018
Anytime :)

Connectez-vous pour commenter.

Plus de réponses (0)

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by