how do I generate new random number every time I run a exe file?

3 views (last 30 days)
I wrote a code that uses randi () and created an .exe file from that code.
When I run the .m file from the Matlab I get a random number every time I run the program, but when I run it from the .exe file I got the same number every time.
How do I get it to generate a new random number every time I run the .exe file?

Accepted Answer

Steven Lord
Steven Lord on 14 Jan 2021
See this documentation page that discusses why random numbers repeat after startup.

More Answers (0)

Categories

Find more on Random Number Generation 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!