LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Fitting data with 'gaps' in

Solved!
Go to solution

Hello all,

 

This may sound a very simple problem but I've been stuck for a short while. Basically I have a data set, see attached, and I want to cut out the peak and fit a polynomial to whats left.

 

I can see two ways to cut out the middle, by either replacing part of the array with NaNs (non-plottable) or simply deleting the offending section.

 

Neither seem to produce a new array which lend itself to fitting, I've attached my VI which can do both (needs a rewire to use either for fitting..).

 

Any ideas?

 

Regards,

 

David.

Download All
0 Kudos
Message 1 of 8
(3,403 Views)
I am posting via phone, so I cannot look at your data. All fitting vi's take xy data. So all you need is to create a new xy data set, containing the retained indices as x and the retained data as y.
0 Kudos
Message 2 of 8
(3,389 Views)

I think I got what you were looking for. Look at the example that I added and see if this does what you want.

Tim
GHSP
0 Kudos
Message 3 of 8
(3,388 Views)

Hi,

 

Thanks for your quick replies. However, aeastet, your VI isn't quite what I'm after.

 

I know its slightly annoying when people use screen grabs, but if you have a quick look at the one attched - from Origin 7- there I can use a data set with missing y-values to fit. This is what I want to do with my data after I have removed the peak - I'm pretty sure just deleting that part of the array is not the way to go so I've edited my VI accordingly.

 

After fitting I intend to use the fit as a background to get an absorbtion spectrum, then do further fitting (which I can do okay with another VI - I think!).

 

Is this any clearer?

 

Many thanks again.

 

D.

Download All
0 Kudos
Message 4 of 8
(3,358 Views)

Use "polynomial evaluation" using the found coefficients to generate the data for any x-values you possibly want. 😄

0 Kudos
Message 5 of 8
(3,328 Views)
Solution
Accepted by topic author SDmanc

 


@altenbach wrote:

Use "polynomial evaluation" using the found coefficients to generate the data for any x-values you possibly want. 😄


 

Try this.... (LV 2010)

 

Download All
Message 6 of 8
(3,319 Views)

That is, exactly, what i was after. Many, many thanks.

0 Kudos
Message 7 of 8
(3,308 Views)

Here's a much better way. Simply set the weight of the undesired points to zero. 😄

 

(Modify as needed, there are many things still to improve.)

0 Kudos
Message 8 of 8
(3,298 Views)