How to put values to zero within a specified range?

12 次查看(过去 30 天)
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 中查找有关 Interactive Control and Callbacks 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by