필터 지우기
필터 지우기

Recompiling an S function, altered results

조회 수: 2 (최근 30일)
John Robinson
John Robinson 2011년 8월 9일
Hello,
I'm trying to restore an old Simulink S-function. The function was last compiled ~2004, and I am trying to recompile it now. I've successfully compiled the C-code using both MS Visual C++ 2008 Express and GCC (via MinGW), and was unsuccessful compiling the code using LCC or Open WATCOM. MATLAB version R2009a.
Currently, when the code is run and compared against the results from the "Old" (2004) mex functions, the results differ. It appears as if a very small initial error propagates. I am using the same conditions for the tests, same version of MATLAB, but I still get small, but distinctively different, changes in the results. From the 2 compilers which I have been successful compiling (GCC and MS Visual C++), I get identical results. I think the code may have been originally compiled with the Intel compiler, which is not available to me. Since the other compilers which I used have identical results, I don't think this is the issue. Also, I have tested in R2009a and R2007b.
Any ideas what could be causing the differences in results? Same source code, same initial conditions, different simulation results.
Thanks a lot for any ideas, I know this isn't a ton to go on.
JR
  댓글 수: 3
Kaustubha Govind
Kaustubha Govind 2011년 8월 9일
Is there a 32-bit vs. 64-bit difference in the platforms?
John Robinson
John Robinson 2011년 8월 9일
No, everything thus far has been 32-bit. Thanks for the idea though.

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

채택된 답변

MarkB
MarkB 2011년 8월 15일
I recommend checking to see if there are any differences in support for floating-point operations. Specifically, check to see if things like math.h have support for both "float" and "double", or just "double" (this difference comes up with ANSI vs ISO implementations of C).

추가 답변 (0개)

제품

Community Treasure Hunt

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

Start Hunting!

Translated by