LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

invert array

I'm having trouble inverting (flipping) an array.

example:
xxx
yyy
zzz

becomes

zzz
yyy
xxx

Im trying to make it happen with a for loop with a delete from array and build array inside, but it's not working.

Any suggestions anybody?
0 Kudos
Message 1 of 5
(5,865 Views)
Hi Arend

If it is a 1D array, there is a built-in vi for this operation in the array palette. Its name is "Reverse 1D array".
Doc-Doc
Doc-Doc
http://www.machinevision.ch
http://visionindustrielle.ch
Please take time to rate this answer
Message 2 of 5
(5,865 Views)
Arend wrote:

> I'm having trouble inverting (flipping) an array.
>
> example:
> xxx
> yyy
> zzz
>
> becomes
>
> zzz
> yyy
> xxx
>
> Im trying to make it happen with a for loop with a delete from array
> and build array inside, but it's not working.

Besides of most probably not using a shift register and choosing the
worst possible solution in terms of performance you have a function in
the array palette called Reverse 1D Array which does exactly what you want.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 3 of 5
(5,865 Views)
Uzytkownik "Arend" napisal w wiadomosci
news:5065000000080000003EEF0000-1079395200000@exchange.ni.com...
> I'm having trouble inverting (flipping) an array.
>
> example:
> xxx
> yyy
> zzz
>
> becomes
>
> zzz
> yyy
> xxx
>
Sugest that method:
2D array>>"Transpose 2D Array" function>> FOR loop: "Reverse 1D Array"
function>>(outside FOR)>> "Transpose 2D Array" function

regards
ZbyStS [Mikrobi]
Message 4 of 5
(5,865 Views)
Thanx, that did the trick.
Message 5 of 5
(5,865 Views)