Main Content

Rational output

`S = rats(`

returns a character vector containing
the rational approximations to the elements of `X`

)`X`

. Asterisks
indicate elements that cannot be printed in the allotted space, but which are not
negligible compared to the other elements in `X`

.

`S = rats(`

specifies
the length of the character vector to use for the rational approximation. For real
inputs `X`

,`strlen`

)`strlength(S)`

is equal to `strlen+1`

,
while for complex inputs it is equal to `2*strlen+3`

. The rational
approximation uses a tolerance that is inversely proportional to the specified
length, as explained in the Algorithms section.

`rats`

obtains rational approximations with ```
[N,D]
= rat(X,tol)
```

, where `tol`

is `min(10^(-(strlen-1)/2)*norm(X(isfinite(X)),1),.1)`

.
Thus, the tolerance is inversely proportional to the output length, `strlen`

.