Main Content

Rational fraction approximation (continued fraction)

returns the
rational fraction approximation of `R`

= rat(`X`

)`X`

to within the default tolerance,
`1.e-6*norm(X(:),1)`

. The approximation is a character array containing
the simple continued
fraction with finite terms.

`___ = rat(___,`

uses additional options specified by one or more `Name,Value`

)`Name,Value`

pair
arguments to approximate `X`

.

You can only specify the

`Name,Value`

arguments, such as`'Length',5,'Positive',true`

, if the array`X`

contains a symbolic number or the data type of`X`

is`sym`

.