LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I multiply all values of a 4-element array with all of its inverse values resulting to an array having all 16 products?

Solved!
Go to solution

I'm quite new to LabVIEW (v.8.0) and I'm trying to figure out the easiest way to have a 4-element array multiplied by its inverse values resulting in a 16-element array

 

Array 1 values = 1, 2, 3, 4

Array 1 inverse values = 1, 0.5, 0.33, 0.25

 

Resulting array = (1, 0.5, 0.33, 0.25, 2, 1, 0.66, 0.5, 3, 1.5, 1, 0.75, 4, 2, 1.32, 1)

 

 

Any advice would be appreciated. Thanks!

0 Kudos
Message 1 of 7
(5,122 Views)
Solution
Accepted by vjm-ndt

You could try something like the following (the last operation is "reshape array")

 

 

Message Edited by altenbach on 03-23-2010 03:07 PM
Message 2 of 7
(5,116 Views)

You can also get a bit more fancy and replace the FOR loop with the "outer product" from the linear algebra palette.

 

 

Message Edited by altenbach on 03-23-2010 04:02 PM
Message 3 of 7
(5,094 Views)

I would like to know how all the elements in an array can be multiplied with just a single number.

 

I tried using the Multiply VI and connected an output array to one of its left terminals and a created a constant at the other left terminal. The right terminal has a waveform graph attached to it. So, will I be able to get the graph output as a scaled graph of the original? 

0 Kudos
Message 6 of 7
(4,793 Views)

Yes, if you multiply an array with a scalar, all elements will be scaled accordingly. Did you try?

0 Kudos
Message 7 of 7
(4,785 Views)