How to put values to zero within a specified range?

조회 수: 6 (최근 30일)
Sam
Sam 2015년 1월 6일
답변: Amit 2015년 1월 6일
I've got a datatype 31x1 double. I want to put the values between -0.5 and + 0.5 to zero. How do I do this?

답변 (1개)

Amit
Amit 2015년 1월 6일
Lets say your data variable is A then:
A(A>-0.5 & A < 0.5) = 0;

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by