Function Reference
— Function File: s = rat (x, tol)
— Function File: [n, d] = rat (x, tol)

Find a rational approximation to x within tolerance defined by tol using a continued fraction expansion. E.g,

          rat(pi) = 3 + 1/(7 + 1/16) = 355/113
          rat(e) = 3 + 1/(-4 + 1/(2 + 1/(5 + 1/(-2 + 1/(-7)))))
                 = 1457/536

Called with two arguments returns the numerator and denominator separately as two matrices.

See also: rats