Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

rat (MathScript RT Module Function)

LabVIEW 2010 Help

Edition Date: June 2010

Part Number: 371361G-01

»View Product Info

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.

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