atmost
Apply an upper limit to the input; make it "at most" this value
Syntax
y = atmost ( x,limit )
y = x.atmost ( limit )
Inputs
| Argument | Type | Description | Unit |
|---|---|---|---|
x | scalar or vector | the input value or array | n/a |
limit | scalar or vector | the limit to impose | - |
Outputs / Return Value
y:yis the matrix, vector, or scalar of the same size asx
Notes
- For a matrix input, a row-wise operation is applied. That is, if limit is a scalar, it is applied to all rows; if it is a vector, each value in the limit vector is applied to each row until it is no longer available.
Examples
x=[2 9 3 4]
x.atmost(5) =
2 5 3 4
x=[2 9 3 4; 23 8 1 70; 201 400 623 300];
x.atmost([5 50 500]) =
2 5 3 4
23 8 1 50
201 400 600 300<p>
See Also
Review Status
- Legacy parameter naming does not exactly match current engine metadata and should be reviewed manually.