01-07-2016 03:36 AM
the problem: First Coloum (A) has 6635 elements, from 0.15 to 30 at a 0.0045 step, secound coloum (B) is random DBL numbers,
Down sample A to 30 linear points (1-30)
the mean of the two Data points in B that match up to the upper and lower limit of each step need to be taken.
a link below is example of the data im working with.
ex: (A,189) = 0.996 (B,189) = 29.83
(A,190) = 1.0005 (B,190) = 34.41
(A,412) = 1.9995 (B,412) = 17.13
(A,413) = 2.004 (B,413) = 14.88
This would be the first point in the new array (A,1) = 1 (B,1) = 32.12
and the secound point would be (A,2) = 2 (B,2) = 16.005
The only whole number in A is Point 30, and its value in B will be used
how would i sort the array to find these values, without using 60 search for elements?
and once you find that element, tell it to grab the data in the next coloum?
Once that is down math nodes or Formule node will finish the vi.
Thanks for any help
Besis
Solved! Go to Solution.
01-07-2016 03:42 AM
Hi Btrah,
your problem reduces to usage of the functions Interpolate1DArray and Threshold1DArray!
What have you tried so far? Where are you stuck?
This forum is very good at helping to solve problems. But we aren't here to present ready-to-use solutions (aka VIs) from scratch!
01-07-2016 09:15 AM
I really dont have good idea how to use the interpolate 1D or the threshold, I have a attched a simple vi that i started with.
01-07-2016 09:22 AM
01-07-2016 11:16 AM - edited 01-07-2016 11:17 AM
A simple "interpolate array" is sufficient if you form an array of points first.
"array of numbers or points can be an array of numbers or an array of points where each point is a cluster of x and y coordinates. If this input is an array of points, the function uses the first element in the cluster (x) to obtain a fractional index by linear interpolation. The function then uses this fractional index to compute the output y value from the second cluster element (y)."
Don't forget to set the cluster size to 2.
The 2D input array contains two columns, one for x and one for y.
01-07-2016 11:29 AM
Hi Christian,
I know that "Interpolation using point array" method as used here some days ago…
The OP had problems to use the basic array functions so I chose to show the traditional way (for a less steep learning curve)…
01-08-2016 12:12 AM
ok guys, thanks for all the help, Im still not getting the right data ouput, i tried many different ways and this what i have come up with.
01-08-2016 12:13 AM
Ii also tried it this way
01-08-2016 12:31 AM
I'm sorry if I little slow on the implementation, I just started with lab view and programming is foreign to me, but I'm learning.
I also work midnights, so I'll try my best to respond to guys in the morning
Thanks for all your help, it is much appreciated.
01-08-2016 02:00 AM - edited 01-08-2016 02:01 AM
Hi Btrah,
it would really help to have VIs (LV2014 preferred) instead of simple images. Those images are hard to debug using LabVIEW!
Hint1: use the AutoCleanup tool (Ctrl-U) before posting VIs/images, it really helps to avoid bended wires! 😄
Hint2: You can edit your own messages in the forum, no need to post two messages within minutes!
Your approach using the WHILE loop looks quite ok (I would move the IndexArray function before the loop and replace the WHILE loop by a FOR loop).
What is the problem here? Saying "not getting the right output" isn't a very helpful error description…