To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This is an example using a Temperature vs Pressure Graph using the ExtrapXLinearBestFit SubVI. The VI reports the X Intercept and the Slope and outputs an array of (X,Y) coordinates for plotting on a graph.
Description
The 'Linear Best Fit' VI included with LabVIEW doesn't extrapolate back to the X axis. This is a very simple idea of how to do so.
The SubVI extends a linear line of best fit back to the X axis as well as extending beyond the end of the data so that you can place it on top of your existing curve on a graph.
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Snippet
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
hey, oli.. i think this will not work..
Any particular reason?
no particular reason i cant tell.. i was also working on the tangential fit to a curve,.. i got it.. nd its somewhat huge code..this one i tried.. but not working with my graph..
It should work fine, it's just an extension of the existing LabVIEW Linear Best Fit VI. The inputs X and Y are your curve data, then the outputs Extrapolated X and Y are a line of best fit extended to the X axis and slightly beyond your original curve. It works for me. I've added an example of how it could be used.