Reputation: 233
I want to check sign of one value within the range by the following rule:
x=1 if x within the [a,b]
x=-1 otherwise
So I implemented by matlab code:
(sign(x-a)+sign(b-x))./2
But my function is not correct. How to make correctly function of my problem?Thank you so much
Upvotes: 1
Views: 69