フィルターのクリア

random matrix with fix data

3 ビュー (過去 30 日間)
som
som 2013 年 1 月 1 日
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,

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 1 月 1 日
s=rng;
randn(4)
rng(s),
randn(4)
  2 件のコメント
som
som 2013 年 1 月 1 日
can you tell me what the 'rng' is? your answer is a bit ambiguse.
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 1 月 1 日
編集済み: Azzi Abdelmalek 2013 年 1 月 1 日
rng restore the original generator settings. Have you tried it? and you can also look at the matlab help
help rng

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeRandom Number Generation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by