LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there an easy way to convert 3 arrays into 1?

Solved!
Go to solution

Hello Labview World:

 

Is there an easy way to convert 3 one-dimentional Arrays into a two-dimentional Array?

as shown below?

 

I've tried the reshape Array vi, but could not get it.

 

thank you much for your help.

 

Screen shot 2010-11-10 at 12.10.56 PM.png

 

\\carlos

 

 

Screen shot 2010-11-10 at 12.10.56 PM.png

0 Kudos
Message 1 of 9
(2,958 Views)
Solution
Accepted by topic author Diego2000

For the posted example this seems to work.

convert array.png

Message 2 of 9
(2,943 Views)

Carlos,

 

Your original arrays are all different sizes.  An array in LV must be rectangular: That is each row must be the same length as all other rows and each column must have the same length as all other columns.  If your arrays are strings as in Matt W's example, the rest of the array will be filled with empty strings.  For numeric the "extra" cells will have zeros.

 

Lynn

Message 3 of 9
(2,931 Views)

As stated above you have to deal with the arrays being different sizes.

Omar
Message 4 of 9
(2,929 Views)

Thank you Matt:

 

I'll sure give it a try...

 

Appreciate your help...

 

\\carlos

 

0 Kudos
Message 5 of 9
(2,914 Views)

Thank you John:

 

Yes, my arrays are of different sizes.

 

The Arrays are strings.

 

thanks Johnsold

0 Kudos
Message 6 of 9
(2,912 Views)

Hello Omar:

 

I've tried your solution and it works.

 Now, I have to put it inside a while loop, because

I have repetitive Arrays of the same flavor.

 

thanks a lot...

 

\\carlos

 

0 Kudos
Message 7 of 9
(2,909 Views)

That good but Matt had a "cleaner" solution. I never can remember how the array function react when the array are of different sizes.

I have been burned before of the output array being the size of the smallest array, losing data.

 

Where and how are your input data arrays coming from?

Where is your output array going?

 

I assume you have some data collection loop (reading data from a DAQ card, reading from a file etc). Then make this 3 array to 1 array in a sub VI and call it as you need it passing the 3 array and getting you output array.

 

Need a little more info on how you plan on using it.

 

Omar

Omar
0 Kudos
Message 8 of 9
(2,896 Views)

Here's a slightly simpler version of Matt's code.

 

0 Kudos
Message 9 of 9
(2,886 Views)