Clear Filters
Clear Filters

Failing randomization through closing matlab

2 views (last 30 days)
Hello everyone,
I am coding an experiment but I ran into a problem regarding the presentation of random stimuli. The experiment includes a trial list which is mostly created using the randi() function. However, everytime I close Matlab and script, the numbers will exactly the same in the next session. This does not happen if a simply leave the matlab window open and rerun the code.
Any ideas concerning the root of this problem?
Thank you in advance!
Best,
Kathrin

Answers (1)

Ameer Hamza
Ameer Hamza on 4 Dec 2020
Edited: Ameer Hamza on 4 Dec 2020
rng('shuffle');
at startup.

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!