LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dual variable curve fitting

heres the problem im dealing with. Im using the curve fitting VI that is part of labview and i would like to supply the x and y coordinates in seperate arrays. i tried using the signal input as one and the "locations" input as the other, but the VI doesnt seem to take the "locations" input into account. basically what im doing (for background) is cutting out portions of data that are greater than a constant, but i cant just remove them from teh array as the other values' positions would change. any help is appreciated.
0 Kudos
Message 1 of 5
(2,873 Views)
It is not entirely clear, but it seems that you just need to remove each bad value both from the "signals" AND "locations" array, to keep the pairs correctly matched up. The fitting itself does not change.

After the fitting, the display needs to be adapted and there are a few possibilities, e.g:

(1) Since the x is now no longer equally spaced, you just need to display the result as an x-y graph, with the "locations" as x, and the "signals" and "best fit" as y.
(2) Alternatively, If you want to keep a waveform graph, recreate the original arrays by replacing all missing values with NaN. Then make a copy and map the best fit results into it. Now display both on the same graph.

Let me know if this is not clear enough. Good luck!
0 Kudos
Message 2 of 5
(2,873 Views)
both arrays are matched up (x and y pairs) the problem im having is that the function itself isnt using the X values (locations) that i plug in.
0 Kudos
Message 3 of 5
(2,873 Views)
Which fitting model are you using? Could yo make a mini demo VI that shows the problem?

From what I can tell in the code (show panel), the x-values are properly used.
0 Kudos
Message 4 of 5
(2,873 Views)
I am having the exact same trouble. The array input into locations for curve fitting VI are not being used. Does anyone have a solution?
0 Kudos
Message 5 of 5
(2,873 Views)