LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to combine two arrays: original array and the array of its interpolation values

Solved!
Go to solution

Hi Mahisnair,

 

can't run your VI because it will not load your text file (errors on ScanFromString)...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 11 of 17
(1,634 Views)

oh god! why it happens that way.. am able to run the same VI.. 😞

by using  "scan from string" i wanted to take the second and sixth colum of values from text file

am attaching the graph the Vi will show

white dots are the orginal array values, red = interpolated values

got the graph after using "interpolate1D array" function on the array conataining values [ white dots on graph], red dot [interpolated] values are obtained as a separate array of values..

need all the values in a single array

 

0 Kudos
Message 12 of 17
(1,630 Views)

oh god! why it happens that way.. am able to run the same VI.. 😞

by using  "scan from string" i wanted to take the second and sixth colum of values from text file

am attaching the graph the Vi will show

white dots are the orginal array values, red = interpolated values

got the graph after using "interpolate1D array" function on the array conataining values [ white dots on graph], red dot [interpolated] values are obtained as a separate array of values..

need all the values in a single array

 

Download All
0 Kudos
Message 13 of 17
(1,628 Views)

Capture3.JPG

 

 

Araay A [ white] + aray B [red] = 100 elements [ condition for interpolation, used]

array B is obtained by intepolating array A

need an array C containing array A with array B values inserted

or is there a function to get it automatically from array A ?? 😞

0 Kudos
Message 14 of 17
(1,619 Views)
Solution
Accepted by Mahisnair

I recommend getting away from using the complex numbers.  It doesn't look like the Sort 1D Array knows what to do with them.  Instead, use the Index & Bundle Cluster Array.  This will put your X-Y combinations in an array of clusters.  You can then use the Build Array to combine the original and the interpolated waveforms together.  Then use the Sort 1D Array to make them sorted in the X axis.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 15 of 17
(1,596 Views)

@crossrulz: Thanks a lot for the solution, its more simple and clever 🙂

 

the X axis in the grapgh is an array with values ranging from 24.5 to 34.2,  

the y axis array has coresponding values for the X axis array.[both combined to give the WHITE dots in the graph]

 

"i have to interpolate X axis and Y axis to get a 100 values in the range [24.5, 34.5] of X axis"

 

 i need to X axis to be[ 24.5, 24.6, 24.7, 24.8, 24.9, 25.0, , ....., 34.2, 34.3, 34.4, 34.5]

but am getting x axis after interpolation as [ 24.5, 24.5, 24.65, 24.8, 24.803, 24.95..............., 33.9, 34, 34.2,34.2]

 

what should i do to get the desired values of X axis and corresponding Y axis during interpolation ?

Download All
0 Kudos
Message 16 of 17
(1,581 Views)

hehe i did it with a slight modification to the interpolation part 🙂

completed vi is attached for any one with similar doubts.

thank you all for the help 

god bless

Download All
0 Kudos
Message 17 of 17
(1,570 Views)