From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to find out the x intercept

Hi,

suppose I have X and Y data points and plotted on XY graph. Now I want to find out the value of X intercept i.e. value of X at which Y=0. Suppose in my data I don't have X value where Y=0. Should I have to interpolate my Y axis to find out the X intercept and if it is so how to do that. 

0 Kudos
Message 1 of 5
(3,520 Views)

What kind of function is it? 

In general case you can use Mathematics -> Scripts & Formulas -> Zeros -> Find all zeros function.

As it needs values between the points, you will need to interpolate.

In simple case (monotonic function) you can use Threshold 1D array for Y to get fractional index of your zero, then Interpolate 1D array to get X.

 

Message 2 of 5
(3,506 Views)

@bdcpp08 wrote:

suppose I have X and Y data points and plotted on XY graph. Now I want to find out the value of X intercept i.e. value of X at which Y=0. Suppose in my data I don't have X value where Y=0. Should I have to interpolate my Y axis to find out the X intercept and if it is so how to do that. 


If you have data on both sizes of zero, you need to interpolate. If the data does not coss zero, you need to extrapolate.

 

This is a trivial problem for clean data, but can be complicated in the presence of noise (it might cross several times over a very narrow range).

How does the data look like? How many times does it cross zero? Is it e.g. nondescending? How much noise do you have? Can it be fit with a low order polynomial, for example?

 

Please attach a VI containing typical data.

Message 3 of 5
(3,490 Views)

Hi altenbach,

 

here I am sending the snapshot of the front panel of my program along with the data and the vi. 

IV.png

Download All
0 Kudos
Message 4 of 5
(3,439 Views)

Try something like this....

 

 

 

(again, this assumes that the Y array is nondescending. If you have noise, you need better tools. There are altrernative versions that operate on the xy cluster array directly)

Download All
Message 5 of 5
(3,413 Views)