External Interfaces |
Compiling and Linking MAT-File Programs
This section describes the steps required to compile and link MAT-file programs on UNIX and Windows systems. It begins by looking at a special consideration for compilers that do not mask floating-point exceptions. Topics covered are:
Masking Floating Point Exceptions
Certain mathematical operations can result in nonfinite values. For example, division by zero results in the nonfinite IEEE value, inf
. A floating-point exception occurs when such an operation is performed. Because MATLAB uses an IEEE model that supports nonfinite values such as inf
and NaN
, MATLAB disables, or masks, floating-point exceptions.
Some compilers do not mask floating-point exceptions by default. This causes MAT-file applications built with such compilers to terminate when a floating-point exception occurs. Consequently, you need to take special precautions when using these compilers to mask floating-point exceptions so that your MAT-file application will perform properly.
The only compiler and platform on which you need to mask floating-point exceptions is the Borland C++ compiler on Windows.
Borland C++ Compiler on Windows
To mask floating-point exceptions when using the Borland C++ compiler on the Windows platform, you must add some code to your program. Include the following at the beginning of your main()
or WinMain()
function, before any calls to MATLAB API functions.
Reading a MAT-File in Fortran | Compiling and Linking on UNIX |
© 1994-2005 The MathWorks, Inc.