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

3 visualizaciones (últimos 30 días)
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?

Respuesta aceptada

Steven Lord
Steven Lord el 14 de En. de 2021
See this documentation page that discusses why random numbers repeat after startup.

Más respuestas (0)

Categorías

Más información sobre Random Number Generation en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by