You want the random generator to be deterministic and work the same in two different implementations.
There is no guarantee that implementations of Matlab and C ++ :: std will generate the same results. Although it would be wise to think that they should - this is the same algorithm. According to Wikipedia , there are options for implementations. The most remarkable difference between the 32 and 64-bit implementation, which gives different results.
To overcome this obstacle, generate numbers in one tool, and then use the same sequence in another. Or use your own algorithm - some ideas here .
source share