mardi 12 avril 2022

rng('default') for rand() function in MATLAB vs Octave

I have a matlab piece of code that generates same random numbers (rand(n,1)) when I initialize with rng('default');

Example:

>> rng('default');
>> rand(3,1)

ans =

    0.8147
    0.9058
    0.1270

Now I need to generate the same output in Octave. Is there an equivalent function for rng('default') in Octave? Please advise on how to get the same set of random numbers as MATLAB in Octave.




Aucun commentaire:

Enregistrer un commentaire