MATLAB: How to set randomization numbers

MATLABrandomrandom number generator

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..

Best Answer

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);
Related Question