How to represent the condition by mathematical

334 Views Asked by At

I have a condtion as $$T(x)= \begin{cases} -1 & \text{if }x <a \\ 0 & \text{if }a\le x \le b \\ 1 & \text{if }x >b \end{cases} $$

I want to represent the above condition as one formula. Could you help me please. This is my formula that I try

$T(x)=\operatorname{sign}(x-a)\cdot(b-x)$ Is it posible if I use $\tanh$ function to represent it?

1

There are 1 best solutions below

1
On BEST ANSWER

$T(x)=\frac{1}{2}\left[\text{sign}(x-a)+\text{sign}(x-b)\right]$