How to know seed directly?
이전 댓글 표시
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!
채택된 답변
추가 답변 (1개)
Greg Heath
2012년 8월 8일
편집: Greg Heath
2012년 8월 8일
0 개 추천
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
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!