MATLAB: Hello, How to clip a sine wave only on positive axis

signal clippingsimulinksine wave

I have a sine wave signal in my Simulink model which oscillates between -50 to +50. But I have to limit the positive side to +3. I tired using switch, but it didn't help. I have added an image for your reference. In that image both positive and negative curves are clipped. I need clipping of positive alone. Thanks!!
– Avinash

Best Answer

Use the MinMax block. Take a "Min" operation with the constant of 3 should do it.