LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
RyanWright

Random number function improvement

Status: Completed

Available in LabVIEW NXG 1.0. The 'Random Number (Range)' node provides this functionality.

Currently, the random number function in LabVIEW only generates a number between 0 and 1.  More often than not, though, random numbers required by applications must be larger than 1.  It would be really nice if the random number function were improved to allow random numbers to be generated within a user-specified range rather than just between 0 and 1.  It might also be nice if the function were improved to allow the user to be able to specify whether random numbers generated were integers or decimal (floating point) numbers and possibly signed numbers (both integers and decimal numbers).

5 Comments
altenbach
Knight of NI

Typically you need more than one random number and we already have a rich collection in the signal generation palette to generate entire random arrays that allows for scaling.

 

Still, I agree that the "dice" could have optional inputs for range and offset, for example. That would simplify things often. (However, it is also trivial to make a custom subVI.) 

 

One thing I do need once in a while is a gaussian distributed random number with given mean and SD. I made my own using the box muller transform.

 

 

 

tst
Knight of NI Knight of NI
Knight of NI

One shortcut you already have today is the OpenG random VI, which does allow you to specify a range.


___________________
Try to take over the world!
Dragis
Active Participant

I ran across a use case again today of being able to wire in a fixed-point data type to Random Number and have it generate full-range white noise for that data type.

Darren
Proven Zealot
Status changed to: In Development
 
Darren
Proven Zealot
Status changed to: Completed

Available in LabVIEW NXG 1.0. The 'Random Number (Range)' node provides this functionality.