Can Matlab program produce different results of Numerical simulation on a same computer at different times?

1 view (last 30 days)
I am doing Numerical simulation on some set of data. It includes running the simulation for many sets of data using the same function. At the end, I extract relevant data points from those simulations and do statistics on those set of points. Each simulation uses a same model function with initial conditions. I ran the program two months ago and received some results based on the extracted points. Two months later, running the same program produced slightly different results in Matlab. Is this possible? Thank you for your time in answering my question in advance.

Accepted Answer

the cyclist
the cyclist on 3 Jul 2014
Simulations often use random numbers. Does yours? Look for functions like rand(), randi(), randperm(), etc.
This randomness can certainly lead to different results, unless you explicitly take steps to avoid that.
  1 Comment
Joseph Cheng
Joseph Cheng on 3 Jul 2014
The only time I've come across is a lsqnonlin result but that was between 32-bit and 64-bit machines, not the same computer.Depending on what your simulation does perhaps it is one of the finding local minimum type of thing.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!