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

5 visualizaciones (últimos 30 días)
FL
FL el 7 de Nov. de 2018
Comentada: madhan ravi el 7 de Nov. de 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

Respuesta aceptada

madhan ravi
madhan ravi el 7 de Nov. de 2018
Editada: madhan ravi el 7 de Nov. de 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 comentarios
FL
FL el 7 de Nov. de 2018
It worked. Thank you

Iniciar sesión para comentar.

Más respuestas (0)

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by