LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

nested for loop index to array

I'm trying to initialize an array (the first two columns) with the following look...
 
0 0
0 1
0 2
1 0
1 1
1 2
2 0
2 1
2 2
 
I could code this easily, but for some reason, I can't get the output of the arrays to work how I want to.  I've been using shift registers, for loops, while loops, and can't get any combination of them to work.  If someone could point me in the right direction, it would help a lot.
0 Kudos
Message 1 of 7
(4,634 Views)
Try the following two possibilities (LabVIEW 7.0). There are many other ways to do it. ;).

Message Edited by altenbach on 07-17-2006 09:19 PM

Download All
Message 2 of 7
(4,626 Views)
Thanks for the quick reply.  I see what you did now; both of them were simple and efficient, very nice.
0 Kudos
Message 3 of 7
(4,611 Views)

How would your nested for loop program look like if you wanted the output to look like?:

 

000111222

012012012

0 Kudos
Message 4 of 7
(3,694 Views)

Try a transpose array after the fact.

0 Kudos
Message 5 of 7
(3,687 Views)

Is there a way to do this by modifying the nested for loops, too?

 

 

0 Kudos
Message 6 of 7
(3,678 Views)

If you look at my old example above (second version), you would just move the built array operation outside the loop to get the output transposed:

 

 

( Of course there is nothing wrong with just transposing the old result as alread suggested.)

 

0 Kudos
Message 7 of 7
(3,670 Views)