LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help.

I need program that build one dimension array , were we can find integer
numbers : 1,2,3....36 , but they can't repeat and they are in disorder (
randomize position ) . I am using lab view 6.1

I need it now , so please , help mi . stochmal@polbox.com
0 Kudos
Message 1 of 2
(2,158 Views)
No prob. The trick is to fill an array of zeros, the same size as the array you want to create. Go through a for-loop once for each element in the array. In each iteration of the for-loop, generate a random index, and check to see if the array contains a zero at that point. If it does, you can put the loop count into that location and go to the next iteration. If it does NOT, find another random index until you find one with a zero in it.

It sounds confusing, but it looks alot better in code. See the attached, well annotated, example. LMK if you need futher help.

Hasta,
Jim
Message 2 of 2
(2,158 Views)