Section: Base Constants
Inf function.
The first form returns a double precision Inf.
y = inf
The next form takes a class name that can be either 'double'
y = inf('double')
or 'single':
y = inf('single')
With a single parameter it generates a square matrix of infs.
y = inf(n)
Alternatively, you can specify the dimensions of the array via
y = inf(m,n,p,...)
or
y = inf([m,n,p,...])
Finally, you can add a classname of either 'single' or 'double'.
Note that infinities are not preserved under type conversion to integer types (see the examples below).
--> inf*0 ans = NaN --> inf*2 ans = Inf --> inf*-2 ans = -Inf --> inf/inf ans = NaN --> inf/0 ans = Inf --> inf/nan ans = NaN
Note that infinities are preserved under type conversion to floating point types (i.e., float, double, complex and dcomplex types), but not integer types.
--> uint32(inf) ans = 4294967295 --> complex(inf) ans = Inf