rat
Rational approximation of real numbers.
[n,d]=rat(a)
[n,d]=rat(a, tol)
Inputs
a An array of real numbers.
tol The desired accuracy of the approximation. Must be a small non-zero positive number.
Outputs
n The integer numerators of the rational approximation.
d The integer denominators of the rational approximation.


Example
>>(n,d)=rat([pi,exp(1)])
>>n
        355       1457

>>d
        113        536