LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Random number

Hello, I want to create a random numer from 0 to 6 increment 1. It means I want to creat in a random 0-1-2-3-4-5 or 6 . How can I do it??....
0 Kudos
Message 1 of 7
(3,484 Views)
Random*6 and convert to integer
Message 2 of 7
(3,483 Views)

Hi , 

 

Try this program

 

Best regards, 

Fawad Nisar
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 3 of 7
(3,474 Views)

Eugen Graf wrote:
Random*6 and convert to integer

This will not be random, because 0 and 6 will only occur at about half the frequency of the other numbers.

 

You need to multiply by 7 and then round towards -inf to get equal probability for all seven numbers.

 

Message Edited by altenbach on 11-06-2008 02:40 PM
Message 4 of 7
(3,472 Views)

Nisar F wrote:

Try this program


Your attachment got lost somehow 🙂

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

yes you are right, am trying to attach it but every time it gives unexpected error, any way you gave the code, thanks

 

Best regards, 

Fawad Nisar
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 6 of 7
(3,457 Views)
If you are using Google Chrome or Safari, attaching a VI will currently fail. You either need to zip it before attaching or use a different browser.
0 Kudos
Message 7 of 7
(3,448 Views)