Effacer les filtres
Effacer les filtres

random matrix with fix data

2 vues (au cours des 30 derniers jours)
som
som le 1 Jan 2013
Hi all,
I generated A matrix including random and normal variable as below:
A=randn(4);
Whenever I run this command, different data will be generated.
How can I generate A matrix with fixed random variable.
I mean in every running A matrix doesn't change.
Thanks,

Réponses (1)

Azzi Abdelmalek
Azzi Abdelmalek le 1 Jan 2013
s=rng;
randn(4)
rng(s),
randn(4)
  2 commentaires
som
som le 1 Jan 2013
can you tell me what the 'rng' is? your answer is a bit ambiguse.
Azzi Abdelmalek
Azzi Abdelmalek le 1 Jan 2013
Modifié(e) : Azzi Abdelmalek le 1 Jan 2013
rng restore the original generator settings. Have you tried it? and you can also look at the matlab help
help rng

Connectez-vous pour commenter.

Catégories

En savoir plus sur Random Number Generation 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