How to set randomization numbers ?

2 Ansichten (letzte 30 Tage)
Ali Najem
Ali Najem am 19 Nov. 2020
Kommentiert: Ali Najem am 19 Nov. 2020
Hi everyone.
I need to set my randmization number for instance:
A=randn(1,2);
B=randn(1,3);
I want this thing, when I run many times I would get the same random numbers kindly, any help will be appreciated..

Akzeptierte Antwort

Ameer Hamza
Ameer Hamza am 19 Nov. 2020
You can give a constant seed at beginning of your code
rng(0); % replace 0 with anything
A=randn(1,2);
B=randn(1,3);

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by