atmost

Apply an upper limit to the input; make it "at most" this value

Syntax

y = atmost ( x,limit )
y = x.atmost ( limit )

Inputs

ArgumentTypeDescriptionUnit
xscalar or vectorthe input value or arrayn/a
limitscalar or vectorthe limit to impose-

Outputs / Return Value

Notes

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