About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
  • Last update: 5 years ago
  • Total downloads: 86
  • Operating system: Linux, Mac OS X, Win All, BSD, Solaris
  • Publisher: ChinSoon Lim
See full specifications

scripts default iconRandom Number Generator (Scripts) Publisher's description

3 MATLAB functions to generate uniformly distributed random numbers in the interval(0, 1)

This zip file contains
1) 3 MATLAB functions to generate uniformly distributed random numbers in the interval(0, 1)
-> randCrypt.mexw32, randChaos.mexw32, randQuant.mexw32
2) 3 C++ files that created these MATLAB functions
->randCrypt.cpp, randChaos.cpp, randQuant.cpp
3) 3 function references that describe each of the MATLAB function call
->randCryptFunctionRef.txt, randChaosFunctionRef.txt,randQuantFunctionRef.txt

Before you download
1) Results from these random generating functions have precision up to a fixed numDecimalPlaces. This means that randCrypt returns number in the interval 10^-numDecimalPlaces : 10^-numDecimalPlaces : 1 - 10^-numDecimalPlaces. Increasing the precision of the number generated increases the time taken.

2) These functions are much slower than the rand available in MATLAB. This is the price to pay for generate true random numbers. Please read their function reference for more details on the time taken. Hence, if pseudorandom numbers work for you, you can ignore these programs.

3) randChaos and randQuant require internet connection to retrieve random bytes from http://www.random.org and http://www.fourmilab.ch/hotbits respectively. I would like to thank the authors of these website for providing these random bytes.

Y = randXXXXX(numDecimalPlaces, m, n)
Y = randXXXXX(numDecimalPlaces,[m n])
Y = randXXXXX(numDecimalPlaces,m,n,p,...)
Y = randXXXXX(numDecimalPlaces,[m n p ...])
Y = randXXXXX(numDecimalPlaces,size(A))

Y = randXXXXX(numDecimalPlaces, m, n) or Y = randXXXXX(numDecimalPlaces, [m n]) returns an m-by-n matrix of random scalar value drawn from a uniform distribution in the interval (0, 1).

Y = randXXXXX(numDecimalPlaces, m, n, p, ...) or Y = randXXXXX(numDecimalPlaces, [m n p ...]) returns an m-by-n-by-p-by-... array of values as described above.

Y = randXXXXX(numDecimalPlaces, size(A)) returns an array that is the same size as A.

Important Notes
1) numDecimalPlaces should be nonnegative integer. The absolute of the negative input is used instead.

2) The size inputs m, n, p, ... should be nonnegative integers. Negative integers are treated as zero.

randXXXXX has been motivated by a need for true random generator and a strong nonrandom pattern in Matlab default random number generator[1].

Please read function references for more credits. Thank you.

Each random number of type double is created as follows. Random bytes are splitted into upper and lower 4 bits. If the upper 4 bits in hexdecimal is less than 10, it is used to create one decimal place. The same applies to the lower 4 bits for the next decimal place. Process is repeated until numDecimalPlaces are created.

Test Example
x = 0:0.00001:1; tic; t = randXXXXX(8,1,10000000); toc; figure; hist(t,x);

Example 1
R = randXXXXX(8,1,1)
R =

Example 2
R = randXXXXX(8,3,4)
R =
0.2190 0.6793 0.5194 0.0535
0.0470 0.9347 0.8310 0.5297
0.6789 0.3835 0.0346 0.0671

System Requirements:

MATLAB 7.2 (R2006a)
Program Release Status: New Release
Program Install Support: Install and Uninstall

Random Number Generator (Scripts) Tags:

Click on a tag to find related softwares

Is Random Number Generator (Scripts) your software?

Manage your software

Most Popular

scripts default icon ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation
scripts default icon Simulink Communication Labs 1.1
Simulink Communication Labs allows you to learn communication systems in greater depth.
scripts default icon M-QAM modulation and demodulation 1.1
M-QAM modulation and demodulation is the QAM modulation and demodulation tech.
scripts default icon LZW Compression/Decompression 1.1
LZW Compression/Decompression - Updated LZW compressor and decompressor with reasonable performance
scripts default icon InSPIRE utility to plot a 2D displacement field (Scripts) 1.0
This program plots the deformation field (displace vectors) contained in vector.txt.