Writing formula in band math

Hi,
I have done spectral unmixing, some frequencies are less than 0 and greater than 1, I want values less than 0 to be 0 and values greater than 1 to be 1, how should the formula be written in band math?

If @<0 then 0 else 1

@ is the band

ِDose this work??

No, not exactly what you want. But it shows the general approach.
With this equation
You get only 0 and 1 values.

The actual equation is:
if (band < 0) then 0 else if (band > 1) then 1 else band
Replace band by the band name you want to use.

2 Likes