How to set randomization numbers ?

2 vues (au cours des 30 derniers jours)
Ali Najem
Ali Najem le 19 Nov 2020
Commenté : Ali Najem le 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..

Réponse acceptée

Ameer Hamza
Ameer Hamza le 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);
  1 commentaire
Ali Najem
Ali Najem le 19 Nov 2020
Thank u so much sir for your answer

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by