How to set randomization numbers ?

2 次查看(过去 30 天)
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..

采纳的回答

Ameer Hamza
Ameer Hamza 2020-11-19
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);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by