LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2d to 1d array conversion

having problems with 2d array conversion to 1d array.  for example there is a 2d array with the first row having 2 values of 5 and 7.
the next row has values 4, 6, and 8. looking like this

A    B
C    D     E

my problem is that when i try and convert to a 1d array using reshape array function, the output has an "empty" array value between the B and the C.  looking like this

A    B   "empty"  C   D    E

is there a way to eliminate the empty array and concatenate the strings to look like A   B   C   D   E.

Thank you
0 Kudos
Message 1 of 4
(2,850 Views)

I think this is what you're looking for.

0 Kudos
Message 2 of 4
(2,836 Views)
The array control will automagically resize the array if any row has more elements than any previous row.  So your array was really:

A B _
C D E

Where "_" is an empty string.  To remove the empty strings, you could use something like this:



I susspect that there is a clever way to do it with array to spreadsheet string and back, but I am not sure exactly how that would work.

Message Edited by jasonhill on 08-11-2006 04:23 PM

0 Kudos
Message 3 of 4
(2,830 Views)
Thank you very much for the help.  the first solution works and i will try the second as well
0 Kudos
Message 4 of 4
(2,822 Views)