LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

minus array.

I have an array of i element and I want to minus each of those elements. This is what I want to do:
while (i>0)
{ NewArray[i]=array[i]-array[i-1];}
it would do nothing when i=0. How can I do that with labview?
0 Kudos
Message 1 of 5
(3,163 Views)
Look in the example attached - thats what you want, If i've understand you correctly.
0 Kudos
Message 2 of 5
(3,163 Views)
attached example excludes the element when i=0

hope this will help you in one way or another.
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 3 of 5
(3,163 Views)
I would use array input indexing tunnel on the loop, as well as a shift
register. Initialize the left hand side of the shift register to zero (for
the first iteration). Inside the loop, subtract the left shift register
from the indexed array element and wire this to an indexing output tunnel.
The indexed array element (wired to the top of the subtract) is also wired
to the right hand shift register. The "NewArray" is on the outside of the
output loop tunnel.
Make sense?

Brian

"Se" wrote in message
news:5065000000080000003E8A0000-1042324653000@exchange.ni.com...
> I have an array of i element and I want to minus each of those
> elements. This is what I want to do:
> while (i>0)
> { NewArray[i]=array[i]-array[i-1];}
> it would do nothing when i
=0. How can I do that with labview?
0 Kudos
Message 4 of 5
(3,163 Views)
Ok, ok... and if we are lazy the simpliest approach is here 🙂
0 Kudos
Message 5 of 5
(3,163 Views)