What is the default random number generation algorithm for 2018b Matlab? ( with randn(1,1) command)

2 views (last 30 days)
Could somebody tell what is the default RNG algorithm for 2018b Matlab?
I generate with this code below ( not using RandStream, etc..):
randn(1,1)
Thanks!

Accepted Answer

Walter Roberson
Walter Roberson on 19 Sep 2022
mt19937ar with a Ziggaurat transform is used for randn() these days.
  3 Comments
Walter Roberson
Walter Roberson on 19 Sep 2022
The rng page says that 'default' initializes twister. Then slightly further down in the description of generator keyword it lists twister and says the generator keyword is mt19937ar .
The RandStream documentation lists the available transforms for randn. And see https://blogs.mathworks.com/cleve/2015/05/18/the-ziggurat-random-normal-generator/
Ant Junior
Ant Junior on 19 Sep 2022
Edited: Ant Junior on 19 Sep 2022
Thanks Walter 🙏🏻 I just thought that randn independently from randstream uses different generation Algol’s that’s why I asked.

Sign in to comment.

More Answers (0)

Categories

Find more on Random Number Generation in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!