LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I randomly choose from a set of number without any repetition?

Solved!
Go to solution

Hi,

I am trying to create a module on randomization without replacement.

I chose sample size to be 10. in other words, there will be ten trials. the number range is 1 to 10. there can not be any repetition during randomly choosing the numbers. I am able to do randomly choosing the number. However, I can NOT avoid the repetition of several numbers. I have attached what I am trying to do in order to avoid the repetition, but have not succeeded.

I am new at using LabVIEW. I will really appreciate your help on resolving this problem.

 

Thanks,

Samia

 

Download All
0 Kudos
Message 1 of 5
(4,122 Views)

Try this...

 

All my comments are in the code.

 

 

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




Message 2 of 5
(4,116 Views)

Start with an array from 1..10 and apply the riffle function.

 

Use the output of the riffle function in order, one element at a time (e.g. via autoindexing).

Message 3 of 5
(4,103 Views)
Solution
Accepted by topic author alams

Or you can make your own, e.g. as follows:

 

Message Edited by altenbach on 06-19-2009 05:41 PM
Download All
Message 4 of 5
(4,100 Views)

THANK YOU SO MUCH matt Bradley and altenbach,

both of your ideas gave me multiple ways to resolve my problem. my module is working perfectlySmiley Happy

 

My problem is resolved. THANK YOU.

Samia Alam

 

0 Kudos
Message 5 of 5
(4,061 Views)