MATLAB: How to avoid duplicate random value when open multiple matlab session

MATLABrandomrandom number generator

Currently I need to open 10 diffierent matlab session simultaneously using a .bat file. In these 10 sessions, i need to generate random number uniformly distributed on the interval 0.25 to 0.5. From what I observe there were a lot of duplication of my random number from these 10 matlab session. My guess is that because they are open simultaneously using the bat file and my interval is quite short, the random seed somehow does not change much.
I am using the rand function to generate random real number
Please help me with this issue. Thank you !

Best Answer

add this in your code
seed = randi(2020);
rng(seed)