Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

rat (MathScript RT Module Function)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info
Download Help (Windows Only)

Owning Class: approximation

Requires: MathScript RT Module

Syntax

s = rat(x)

s = rat(x, tol)

[n, d] = rat(x)

[n, d] = rat(x, tol)

Description

Approximates real or complex numbers using rational fractions.

Examples

Inputs

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.

Outputs

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.

Details

The following table lists the support characteristics of this function.

Supported in the LabVIEW Run-Time Engine Yes
Supported on RT targets Yes
Suitable for bounded execution times on RT Not characterized

Examples

[N, D] = rat(pi, 1e-8)


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit