LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

two different sized arrays

When adding two different sized arrays, I found it produces an array fitting into a less sized array. In other words, for example, there are two arrays, one with 10 elements and the other with 20 elements. When you add the two arrays, you have an array with 10 elements. Which means you loose later part of the array of 20 elements. Could you help me with a way to add two arrays to fit into a more sized array, so that you can have a 20 element resultant array for the above example.
0 Kudos
Message 1 of 2
(3,595 Views)
One way is to pad the lesser size array with 0 value elements to make it the same size of the large size array, then add them together.

Another way is to put the add operation insize a loop, and auto index the larger size array, use index array for the lesser size array. Then auto index the output to create the result array. See the attached image for this.

Joe
Message 2 of 2
(3,595 Views)