Problem with Data Mask



I am having trouble using a mask. I would like to mask all my points that are not contained in the range -2 to 2. Previously I was using the command

mask = (chirpwavegauss >= -2 ? 1 : 0)

but I cannot make it work in this way :

mask = (2>= chirpwavegauss >= -2 ? 1 : 0)

How should I rewrite it to make it work?

Thanks!
you could be doing something like this:

mask = chirpwavegauss >= -2 ? 1 : 0
duplicate/o mask tmp
mask = chirpwavegauss <= 2 ? 1 : 0
mask *=tmp
KillWaves/Z tmp


Assuming you have constructed your mask wave to match the size and scale of the original, try

mask =( abs(chirpwavegauss)<=2 ) ? 1 : 0
mask = chirpwavegauss>=-2 && chirpwavegauss<=2


You don't need to use ?: here because the comparison operators (e.g., >=) and the logical operators (e.g., &&) both return 0 if false and 1 if true.
... and let's not forget
MatrixOP/O mask=greater(2,abs(chirpwavegauss))

which should be more efficient.