LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert text file into 1d cluster with 2 elements to search

Solved!
Go to solution

How can I get the output array to be the same as the input array in the vi. I can use the input array as the input to the Interpolate vi and works. However, I can't get the Output array I am building to match the input array. 

0 Kudos
Message 1 of 3
(880 Views)
Solution
Accepted by topic author bassinbc

I would recommend a few tutorials:

 

You need to read the input as array with two columns, then convert each row to a cluster of two elements, giving you an output array with one cluster element per row. Here is one possibility, but there are many others.

 

altenbach_0-1612374167931.png

 

 

Your mistakes:

  • You have two columns in the input, so you need to convert it into a 2D array. You only get the first value (1) and the values that are preceded by a tab (second column) for a total of five elements..
  • So you create a 1D array with five elements and convert it to a cluster with 2 elements, dropping even more input data.
  • Then you built that cluster into an array with one element. Interpolating into an array of point with only one element is quite useless.
  • ...
0 Kudos
Message 2 of 3
(853 Views)

@altenbach wrote:

 Here is one possibility, but there are many others.


A relatively rare function can do it without the FOR loop if you prefer this (The FOR loop is easier to understand):

 

 

altenbach_0-1612375566687.png

 

0 Kudos
Message 3 of 3
(840 Views)