# range

Numerical range of `fi` or `quantizer` object

## Syntax

`range(a)[min_val, max_val]= range(a)r = range(q)[min_val, max_val] = range(q)`

## Description

`range(a)` returns a fi object with the minimum and maximum possible values of `fi` object `a`. All possible quantized real-world values of `a` are in the range returned. If `a` is a complex number, then all possible values of `real(a)` and `imag(a)` are in the range returned.

`[min_val, max_val]= range(a)` returns the minimum and maximum values of `fi` object `a` in separate output variables.

`r = range(q)` returns the two-element row vector r = [a b] such that for all real x, `y` = `quantize(q,x)` returns y in the range ayb.

`[min_val, max_val] = range(q)` returns the minimum and maximum values of the range in separate output variables.

## Examples

```q = quantizer('float',[6 3]); r = range(q) r = -14 14 q = quantizer('fixed',[4 2],'floor'); [min_val,max_val] = range(q) min_val = -2 max_val = 1.7500 ```

## More About

collapse all

### Algorithms

If `q` is a floating-point `quantizer` object, a = -`realmax`(q), b = `realmax`(q).

If `q` is a signed fixed-point `quantizer` object ```(datamode = 'fixed')```,

`$a=-\mathrm{realmax}\left(q\right)-\mathrm{eps}\left(q\right)=\frac{-{2}^{w-1}}{{2}^{f}}$`
`$b=\mathrm{realmax}\left(q\right)=\frac{{2}^{w-1}-1}{{2}^{f}}$`

If `q` is an unsigned fixed-point `quantizer` object ```(datamode = 'ufixed')```,

`$a=0$`
`$b=\mathrm{realmax}\left(q\right)=\frac{{2}^{w}-1}{{2}^{f}}$`

See `realmax` for more information.

## See Also

Was this topic helpful?

Get trial now