Effacer les filtres
Effacer les filtres

code running differently on 2 machines

2 vues (au cours des 30 derniers jours)
darksideofthemoon101
darksideofthemoon101 le 21 Avr 2011
Hi,
I'm running code on 2 machines, 1 laptop and 1 desktop. I have an array that comes out of a loop, 'answer1', and the when I execute the code on each machine it comes out differently.
On the laptop the array is 120x1 and has values from 6.5211E-7 to 5.3847E-8. On the desktop the array is the same size bu is all zeros.
I have just noticed that several variables on the desktop version display many elements in the workspace pane, however the variables themselves do seem to contain numbers.
Anyone any ideas? I can attempt to upload code if needed.
Thanks.
  1 commentaire
Jarrod Rivituso
Jarrod Rivituso le 21 Avr 2011
I would step through the code using the debugger to see where things start to go wrong, and then investigate from there. Sometimes, these things can be as easy as a missing file on one machine or another.

Connectez-vous pour commenter.

Réponse acceptée

William
William le 21 Avr 2011
You could look at several implementation issues for the source of your problem. I've listed a sequence of questions below that may be of help.
Are both machines the same processor? Same processor type x86 vs 64bit? Execute 'eps' on both machines to see what the smallest possible value is. If eps is different then rounding 'errors' may exist. Are you using the same Matlab version?
It is possible that different Matlab versions could include bug fixes.
If you don't control the machines someone may have replaced one of the functions you are using with a local directory or path copy with slightly altered output.
Does the function you are using depend upon random or seed values?
As an alternative to the debugger you could try the profile tool or look at intermediate output.

Plus de réponses (0)

Catégories

En savoir plus sur Debugging and Analysis dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by