Approximates real or complex numbers using rational fractions.
s = rat(x)
s = rat(x, tol)
[n, d] = rat(x)
[n, d] = rat(x, tol)
Real or complex scalar, vector, or matrix.
Tolerance of the approximation. tol is a positive real number. If tol is less than or equal to 0, MathScript uses the default value.
Approximation result as a string.
Numerators of the approximation. n is a scalar, vector, or matrix whose length is the same as that of x.
Denominators of the approximation. d is a scalar, vector, or matrix whose length is the same as that of x.
[N, D] = rat(pi, 1e-8)
Where This Node Can Run:
Desktop OS: Windows
FPGA: This product does not support FPGA devices