Qu

clip

Builtin index · Core maths

result = clip(x, lo, hi)

Input: x, lo, hi · Output: result

What it is

Elementwise clamp of x (a scalar, Vec, or Mat/Signal) into [lo, hi]. lo and hi are scalars (or broadcastable arrays); both are optional, defaulting to -inf/+inf respectively, so e.g. clip(x, 0) floors at zero and leaves the top end open.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = clip(x, lo, hi)
x scalar, Vec, Mat, or SignalElementwise clamp of x (a scalar, Vec, or Mat/Signal) into [lo, hi].
lo scalarlo and hi are scalars (or broadcastable arrays).
hi scalar, Vec, Mat, or SignalElementwise clamp of x (a scalar, Vec, or Mat/Signal) into [lo, hi].
result —
Returns the same shape as x.

Examples

No documentation example calls this form yet. The Core maths chapter is where one belongs.

See also

clamp — documented in the same entry.