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

조회 수: 6 (최근 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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by