View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
True Random Integer Generator

5.0 | 4 ratings Rate this file 9 Downloads (last 30 days) File Size: 1.83 KB File ID: #21353 Version:

True Random Integer Generator


Ameya Deoras (view profile)


05 Sep 2008 (Updated )

Download true (not pseudo-) random numbers from's generator

| Watch this File

File Information

The function TRUERAND returns truly random integers using's Random Integer Generator. According to, the numbers are generated based on atmospheric noise and skew-corrected to generate uniform numbers. The generated numbers have been shown to pass the NIST tests for RNGs.
The range of numbers is -1e9 to 1e9 and the maximum number of values that can be generated is 10,000

truerand(rows,cols,min,max) returns a matrix of size rows-by-cols with random integers between min and max.

truerand(n,min,max) returns an n by 1 vector

truerand(n, m), truerand(n) and truerand use the default values min = 1, max = 100

 y = truerand
 y = truerand(9)
 y = truerand(6,6)
 y = truerand(5,1,20)
 y = truerand(3, 4, 15, 30)

For more information visit


This file inspired Generate Uniform Pseudo Random Integers From Linear Range..

MATLAB release MATLAB 7.6 (R2008a)
Other requirements The function requires an internet connection (it relies on URLREAD).
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (4)
05 Mar 2016 Maneet Goyal

22 Feb 2015 Jeffrey

The website url has changed to https and this should be update in the code. Otherwise, this function works great.

19 Feb 2013 JR King

Very nice.

Could you add options to include other types of randomness (gaussian etc)?

Thank you!


14 Sep 2009 Ilya Valmianski

Very nice

01 Sep 2016

Updated license

Contact us