필터 지우기
필터 지우기

code running differently on 2 machines

조회 수: 2 (최근 30일)
darksideofthemoon101
darksideofthemoon101 2011년 4월 21일
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
Jarrod Rivituso
Jarrod Rivituso 2011년 4월 21일
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.

댓글을 달려면 로그인하십시오.

채택된 답변

William
William 2011년 4월 21일
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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Debugging and Analysis에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by