Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Smallest and largest elements

```
[S,L] =
bounds(A)
```

`[S,L] = bounds(A,'all')`

```
[S,L] =
bounds(A,dim)
```

`[S,L] = bounds(A,vecdim)`

```
[S,L] =
bounds(___,nanflag)
```

`[`

computes the smallest and largest values based on the dimensions specified in the
vector `S`

,`L`

] = bounds(`A`

,`vecdim`

)`vecdim`

. For example, if `A`

is a matrix,
then `bounds(A,[1 2])`

returns the smallest and largest values over
all elements in `A`

, since every element of a matrix is contained
in the array slice defined by dimensions 1 and 2.