atmost

Parent Previous Next

atmost

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

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

arg

type

Description

Unit or Value scale

x

SCAL or VCT

the input value or array


limit

SCAL or VCT

the limit to impose


Outputs

  • y is the matrix, vector, or scalar of the same size as x

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

See Also

atleast | max | min

Created with the Personal Edition of HelpNDoc: Free EPub and documentation generator