Clear Filters
Clear Filters

Does the matlab version affect on your code's output ?

5 views (last 30 days)
Does the matlab version affect on your code's output ?

Accepted Answer

Stephen23
Stephen23 on 24 Jun 2016
Edited: Stephen23 on 4 Jul 2016
Yes.
  • Some MATLAB versions changed the order of results (for an example see unique, setdiff, etc, and search for "legacy").
  • Functions get rewritten to accept different inputs, which means the outputs may also change (see example).
  • Bugs get fixed, which may change the output.
  • Changes to the underlying algorithms also occur, which can change numeric results at the lowest precision digits (see example). Christine Tobler (who works for TMW (which makes MATLAB)), said "The reason that the results changed is likely due to a difference in the order of operations. This will affect the results in small ways, without there necessarily being a better or worse result. Such small changes are likely to happen between any two MATLAB versions". So even TMW say that changes happen between MATLAB versions.
  • LAPACK and other supporting libraries can change the outputs. For example qr changed dramatically (although mathematically equally correct) between LAPACK versions, and hence between MATLAB versions as well, as explained here.

More Answers (1)

Andreas Goser
Andreas Goser on 24 Jun 2016
It rarely does. Mostly it is not the release, but you also changed from 32 to 64 bit at the same time. This is an entirely differnt topic though. Sometimes, default options for some functions change. I e.g. recall something in Optimization Toolbox a couple of years ago.
If you suspect a bug, please get in touch with Technical Support.
  3 Comments
Andreas Goser
Andreas Goser on 28 Jun 2016
This background information is not enough. My answer remains unchanged. You should provide all code and data needed to technical support.
Walter Roberson
Walter Roberson on 28 Jun 2016
As Stephen correctly indicated, there are a number of reasons why output can be different. The output is not usually very different, but it can happen, as there are some algorithms that are very sensitive to numeric round-off. Also, some MATLAB functions change default settings.
Some aspects of the random number generator system changed in R2013a and so could potentially have made a difference between R2012* and R2014*.
I would not suggest going to technical support with this quite yet; I suggest posting the code here, as people here might be able to point out reasons the output might have changed.

Sign in to comment.

Categories

Find more on Get Started with MATLAB 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!