how to use randperm with a seed?

while using randperm function i need matlab to remember the previous values and not to repeat them in the next run (inside a loop) how can i do this?

답변 (1개)

James Tursa
James Tursa 2014년 10월 29일

0 개 추천

In general you will get a different set by default, but it is possible to get the same set. If you want to preclude this I would suggest writing your own function that calls randperm. In your function, store the most recent result in a persistent variable. You can then compare this on each call to guarantee that successive sets are not the same.

카테고리

도움말 센터File Exchange에서 Share and Distribute Software에 대해 자세히 알아보기

제품

질문:

2014년 10월 29일

답변:

2014년 10월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by