Converting fortran code to matlab
1 次查看(过去 30 天)
显示 更早的评论
Hello,
I have a Fortran .dll compiled on a Win32 XP machine and the fortran source code. I moved the code to Matlab to be more flexible on new code development. Comparing the results of the .dll and the Matlab code I receive a relative accuracy error between 0.01% and 3%. My question is:
- both programms use double resp. real*8 numbers
- both programms are running on the same computer.
Why do I get these errors in accuracy?
Gerd
0 个评论
采纳的回答
Walter Roberson
2011-4-19
Fortran and MATLAB may use different default rounding schemes.
When you converted the code to MATLAB, did you ensure that all of the operations would be done in exactly the same order as in Fortran? MATLAB's order of operations may be different than Fortran even for identical code lines.
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fortran with MATLAB 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!