| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
MEX-Files Must Be Recompiled When -largeArrayDims Becomes Default MEX Option
New Function Displays Information about MEX Compiler Configurations
New Functions to Catch Errors in MEX-Files Replace mexSetTrapFlag
Microsoft Visual Studio "X64 Compilers and Tools" Required for 64-bit Systems
Run-Time Libraries Required for Applications Built with Microsoft Visual Studio 2008 Compiler
Do Not Use get or set Function to Manage Properties of Java Objects
COM Objects Might Display Different Number of Supported Events
In the future, on 32-bit Microsoft Windows systems, MATLAB will not support MEX-files with a .dll file extension. In MATLAB Version 7.7 (R2008b), if you run a MEX-file with a .dll file extension, MATLAB displays a warning.
Additionally, if you use the mex function with the -output switch to create a MEX-file with a .dll extension, MATLAB displays a warning. If you use the -output switch to name a MEX-file, you do not need to provide a file extension. MATLAB automatically appends the appropriate extension. For example, the following command creates a MEX-file named newtest.mexw32:
mex mytest.c -output newtest
You must recompile MEX-files with a .mexw32 file extension. This is the default of the mex command.
In a future version of MATLAB, the default mex command will change to use the large-array-handling API. This means the -largeArrayDims option will be the default. For information about migrating your MEX-files to use the large-array-handling API, see the Technical Support solution 1-5C27B9.
In the near future you will be required to update your code to use the new API and to recompile your MEX-files. You should review your source MEX-files and mex build scripts.
MATLAB Version 7.7 (R2008b) supports these new compilers for building MEX-files:
Microsoft Visual Studio 2008 Express Edition
The following compilers are supported in Version 7.7 (R2008b), but will not be supported in a future version of MATLAB.
Intel Visual Fortran Version 9.1
Microsoft Visual Studio .NET Version 7.1
Open Watcom Version 1.3
Intel Visual Fortran Version 9.1
Sun Studio 11 cc / CC Version 5.8
Sun Studio 11 f90 Version 8.2
The documentation for the mxSetCell, mxSetField, and mxSetFieldByNumber functions in the MATLAB C and Fortran API incorrectly instructs customers to use mxFree to release memory for any mxArray returned by mxGetCell, mxGetField, or mxGetFieldByNumber.
The correct function to use to release memory for an mxArray is mxDestroyArray. Calling mxFree on an mxArray only frees the array header, but does not actually free the data itself and can result in a memory leak.
To help diagnose this problem, MATLAB issues a warning if calling mxFree on an mxArray could cause memory corruption. In future versions of MATLAB, this condition might result in a segmentation violation.
The mex.getCompilerConfigurations function displays information about the selected compiler and associated switches and options that MATLAB uses to build a MEX-file. The selected compiler is the one you choose when you run the mex -setup command. For more information, see Building MEX-Files.
Two new MEX library functions have been added to the MATLAB C and Fortran API.
The mexCallMATLABWithTrap function, like mexCallMATLAB, lets you call M-code from within a MEX-file. In addition, mexCallMATLABWithTrap lets you catch, or trap, errors. Using this function for exception handling is more flexible that using mexCallMATLAB with the mexSetTrapFlag function.
Likewise, the mexEvalStringWithTrap function adds error handling to the mexEvalString function.
In the near future you will be required to update your MEX-files to remove use of the mexSetTrapFlag function.
When compiling MEX-files on an Apple Mac OS Version 10.5 system you can ignore a warning about a duplicate library libz.1.dylib. The MEX-file builds properly and runs as expected. The warning message contains the following information:
ld: warning, duplicate dylib
If you use Microsoft Visual Studio with MATLAB on 64-bit systems, you must choose "X64 Compilers and Tools" when you install the following products:
Visual Studio 2008 Express Edition
Visual Studio 2008 Professional Edition
Visual Studio 2005 Professional Edition
If you distribute a MEX-file, an engine application, or a MAT-file application built with the Visual Studio 2008 compiler, you must provide the Visual C++ run-time libraries. These files are required to run applications developed with Visual C++ on a computer that does not have Visual C++ 2008 installed. For information on locating the Microsoft Visual C++ 2008 Redistributable Package (x86), containing vcredist_x86.exe and vcredist_x64.exe, consult your Microsoft documentation.
If you want to read or update a property of a Sun Java object created in MATLAB using the Java class constructor, do not use the MATLAB get or set functions on the property. For example, if you create a Java object called javaObject that has a property called PropertyName, the following commands might cause memory leaks and will be deprecated in a future version of MATLAB:
propertyValue = get(javaObject, 'PropertyName'); set(javaObject, 'PropertyName', newValue);
In future versions of MATLAB, using get or set on Java objects to manage the properties will generate an error. The correct commands to use are:
propertyValue = javaObject.getPropertyName; javaObject.setPropertyName(newValue);
If you use events from COM servers implementing event interface versioning, COM objects created with MATLAB Version 7.4 (R2007a), Version 7.5 (R2007b), or Version 7.6 (R2008a) might have a different number of supported events than COM objects created with MATLAB Version 7.7 (R2008b) or any version prior to 7.4.
Calling the events (COM) function on affected types of COM server components returns a list of events for the latest [default] interface version which might be different from the list of events displayed by MATLAB Version 7.4, Version 7.5, or Version 7.6.
If an event in an older COM event interface version is no longer supported or renamed in the newer interface version, the registerevent function generates an error when such an event is used in M-code.
![]() | Creating Graphical User Interfaces (GUIs), MATLAB Version 7.7 (R2008b) | Version 7.6 (R2008a) MATLAB Software | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |