Are MATLAB's inbuilt functions and official toolboxes cross-platform consistent?

2 vues (au cours des 30 derniers jours)
I am writing some code which would be executed on different operating systems, both inside MATLAB and in MCR enviroment. My code does not make use of any random number generator (i.e. the algorithm is completely deterministic) and only make use of inbuilt functions and official toolboxes. I want to know if the inputs are exactly same then would the outputs generated on different platforms be exactly same? In other words, if macOutput and winOutput are output arrays on Mac and Windows platform respectively, then would following always return true ?
isequal(macOutput, winOutput)

Réponse acceptée

Andreas Goser
Andreas Goser le 28 Juil 2014
I would like to respond to a modified version of this question: "How can I make sure the behaviour and numerical results of MATLAB applications are identical across platforms?"
Note that I write "platform" and not "OS", as one important factor in the area of numerical results is the 32bit/64 bit architecture differences and the 32/64 bit MATLAB versions. You may also have slightly different results as of BLAS differences. When using e.g. optimization routines, this can result in large differences. The robustness is depending on data and algorithms.
As for OS, the biggest difference I am aware of is about interfaces with other applications or OS. Like reading from Excel or creating MEX files (being depending on different C Compilers).
  2 commentaires
CBhushan
CBhushan le 28 Juil 2014
Thanks for the explanation.
As of now, I am only concerned about 64-bit MATLAB/MCR versions. Can you please elaborate a little bit more about differences in outputs of optimization routines (& BLAS)? Can the outputs be different on different platforms (limited to 64-bit case)? And as you mentioned in the modified question, is there anything which I can do to make the numerical results identical across platforms?
Just to make clear, I am not concerned about accuracy of the results for some ill-posed problem. I am concerned about numerical consistency of the results across platforms.
Andreas Goser
Andreas Goser le 29 Juil 2014
In general you can expect numerical results are the same. I am kind of "collecting" reasons for different results, but the feedback frm the community is limited: http://www.mathworks.com/matlabcentral/answers/438-why-are-computational-results-in-matlab-sometimes-different-on-different-machines-and-how-can-i-prev - which get be seen as something good, as it rarely happens. Basically if you can exclude what you call "some ill-posed problem", then you'll be fine.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by