Randperm same sequence each time you run the code
조회 수: 8 (최근 30일)
이전 댓글 표시
Is there a possibility to have each time the same random permutation when you run the code to make results comparable?
randperm(length(X))
I want to have the random numbers in the same order everytime the code is run.
댓글 수: 0
채택된 답변
Ameer Hamza
2018년 5월 26일
편집: Ameer Hamza
2018년 5월 26일
See the random number generator with the same number. For example, add this line before running randperm()
rng(5); % you can use any number instead of 5
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!