random number generation: MATLAB vs Fortran

3 vues (au cours des 30 derniers jours)
Hsinho
Hsinho le 16 Août 2012
Hi,
I am a MATLAB user.
I am curious about the difference of random number generation in MATLAB and Fortran.
I know from Help file that MATLAB use "Mersenne twister" as the generator with an approximate period,2^19936-1.
I have no idea about Fortran. Do both use the same best random number generator?
  1 commentaire
Peter Perkins
Peter Perkins le 17 Août 2012
MATLAB has several choices of generator. The Mersenne Twister (mt19937ar, to be specific) is the default that MATLAB sets up at start-up, but you are free to choose any of the others at any time. See the documentation for the RNG function.

Connectez-vous pour commenter.

Réponse acceptée

Matt Fig
Matt Fig le 16 Août 2012
Fortran 95 is listed having an implementation of the Mersenne algorithm available for use.
As this algorithm was developed in 1997 I don't think Fortran 90 would have it...

Plus de réponses (0)

Catégories

En savoir plus sur Fortran with MATLAB dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by