How to know seed directly?
Show older comments
Hi,
I use "rng" to know which seed was selected after doing "rng shuffle."
How can I only know the seed directly? I don't need to know "type" and "state."
Thanks!
Accepted Answer
More Answers (1)
Greg Heath
on 8 Aug 2012
Edited: Greg Heath
on 8 Aug 2012
0 votes
I think it is better to determine the seed before you generate the random numbers. In particular,
Either assign the seed first or determine the current seed before using shuffle.
If you know that you are going to use random numbers, it is convenient to set the seed at the beginning of the program when space and figures are cleared. For example:
close all; clear all; clc;
plt = 0; rng(4151941);
. . .
plt = plt+1; figure(plt);
. . .
Hope this helps.
Greg
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!