From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mathematical Operation On Arrays

Solved!
Go to solution

Hi

 

Hope someone can help me with this. How do I (add, subtract..etc) each element between 2 arrays or more. Lets's say I have an array1 with element (5,10,15,20)  and array2 with (2,4,6,8)  . I need to multiply 5 with 2, then 4, then 6, then 8 and then 10 with 2,4,6,8.....and the list goes on....all the multiplied valued show also be shown in a new array....

 

Thanks

0 Kudos
Message 1 of 5
(3,000 Views)

Like this?

 

array.JPG

0 Kudos
Message 2 of 5
(2,988 Views)
Solution
Accepted by topic author Coco Banana
array1.JPG
Message 3 of 5
(2,987 Views)
You have not specified what kind of output you want. The above answers produce a 2D array. If you want a 1D array, you can reshape later, e.g. as described here. (In the case of multiplication, you can also use the outer product).
Message 4 of 5
(2,979 Views)
I had suggested the reshape array as well/
Message 5 of 5
(2,948 Views)