Owning Class: approximation
Requires: MathScript RT Module
s = rat(x)
s = rat(x, tol)
[n, d] = rat(x)
[n, d] = rat(x, tol)
Approximates real or complex numbers using rational fractions.
| Name | Description |
|---|---|
| x | Specifies a real or complex scalar, vector, or matrix. |
| tol | Specifies the tolerance of the approximation. tol is a positive real number. The default is 1e-6*max(abs(x)). If tol is less than or equal to 0, LabVIEW uses the default value. |
| Name | Description |
|---|---|
| s | Returns the approximation result as a string. |
| n | Returns the numerators of the approximation. n is a scalar, vector, or matrix whose data type and length are the same as those of x. |
| d | Returns the denominators of the approximation. d is a scalar, vector, or matrix whose data type and length are the same as those of x. |
[N, D] = rat(pi, 1e-8)