I want to replace values in an interval [a,b] by 0 in a list of values.
Example:
{{.5,.2,.49,1,1},{.49,.5,.495,1}}
I want to get:
{{0,.2,0,1,1},{0,0,1,1}}
I try like :
{{.5,.2,.49,1,1},{.49,.5,.495,1}}/.{(#>=.49&&#<=.5)&->0}
But it does not work.
Conditionas expressed by Karsten below. I encourage you to familiarize yourself with other options such as the numeric methods as they can have significant performance advantages. Please let me know if you have any trouble applying methods shown there to your specific problem. – Mr.Wizard Oct 18 '14 at 05:47