Y = clip(X, lowerBound, upperBound)
| Parameter | Description |
|---|---|
| X | a numeric or logical array. |
| lowerBound | a numeric scalar: lower limit of the range. |
| upperBound | a numeric scalar: upper limit of the range. |
| Parameter | Description |
|---|---|
| Y | the clipped array, same size as X. |
clip limits the values of X to the interval [lowerBound, upperBound].
Values smaller than lowerBound are set to lowerBound and values greater than upperBound are set to upperBound.
NaN values in a floating-point input are preserved.
Y = clip([-2 0 5 10], 0, 8)
| Version | Description |
|---|---|
| 1.13.0 | initial version |