- Community Home
- :
- Discussion Forums
- :
- Most Active Software Boards
- :
- LabVIEW
- :
- Rational Fraction Approximation in Labview

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted

10-03-2016 03:14 PM

Options

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi,

I am trying to do the equivalent of the following matlab function in labview:

[N, D] = rat(X,tol)

I have been using the mathscript but it does not recognize my equation. Is there a better way to do this?

Solved! Go to Solution.

Solution

Accepted by topic author A2saSandel

10-11-2016 09:23 AM

10-03-2016 04:05 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Gonna need to take a ride in the wayback machine all the back to 2004. I first encountered the need for a similar function when generating a repetitive sine wave. It helped me determine the right # of cycles to put into a repeating buffer so that the correct sinusoid frequency could be generated despite having only discrete output sample rates available.

The whole thread is here. The good stuff is found at the end in this post, where I attached 2 LabVIEW-coded methods for calculating a rational approximation. You'll probably need the context of the rest of the thread to decipher the use of terms and names of parameters though.

-Kevin P

10-07-2016 09:32 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

MathScript should support that syntax. You can check the online help of 'rat' in the following link.

http://zone.ni.com/reference/en-XX/help/373123C-01/lvtextmath/msfunc_rat/

10-08-2016 01:39 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

I did a search for Continued Fraction Approximation, and came across this interesting paper. It should be fairly simple to program this algorithm in LabVIEW directly (no need for MathScript).

Bob Schor