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.

Create array of all `Inf`

values

`X = Inf`

`X = Inf(n)`

`X = Inf(sz1,...,szN)`

`X = Inf(sz)`

`X = Inf(___,typename)`

`X = Inf(___,'like',p)`

`X = Inf`

returns the scalar representation of positive
infinity. `Inf`

results from operations that return values too
large to represent as floating-point numbers, such as `1/0`

or
`log(0)`

.

For double-precision, `Inf`

represents numbers larger than
`realmax`

. For single-precision, `Inf`

represents numbers larger than `realmax('single')`

.

`X = Inf(`

returns an
`sz1,...,szN`

)`sz1`

-by-...-by-`szN`

array of
`Inf`

values, where `sz1,...,szN`

indicate
the size of each dimension. For example, `Inf(3,4)`

returns a
3-by-4 matrix.

`X = Inf(___,`

returns an array of `typename`

)`Inf`

values of data type
`typename`

, which can be either `'single'`

or `'double'`

.