External Interfaces/API, MATLAB® Version 7.3 (R2006b)

New Types for Declaring Size and Index Values

Version 7.3 (R2006b) defines two new types for API arguments and return values. These are

Using these types in array declarations replaces more specific type declarations such as int or INTEGER*4. In general, using these types consistently in your C or Fortran source files can insulate your code from changes in the API implementation that might take place between different versions of MATLAB®.

The mwSize and mwIndex types are required when working with functions that access sparse arrays on a 64-bit system. This is described in the release note on Sparse Arrays on 64-bit Systems, below.

Sparse Arrays on 64-bit Systems

The internal storage of sparse arrays on 64-bit systems has changed in the R2006b release. Due to this change, you will need to

See the section on Compatibility Considerations to find out if you will need to make any modifications to your existing MEX code to accommodate these changes.

Sparse API Functions Affected By This Change

You will need to recompile any MEX-files that use the following sparse functions on a 64-bit system:

New MEX Switch

In order to build MEX-files that use any of the sparse array functions listed above, you need to compile these files with the -largeArrayDims switch, as shown here:

mex -largeArrayDims filename

Also, any existing MEX-files that interact with sparse arrays in MATLAB Version 7.3 must be recompiled using the -largeArrayDims switch.

Compatibility Considerations

If you are using any of the functions listed above, then you should be aware of the following potential compatibility issues if your MEX code uses sparse arrays on a 64-bit system:

New MAT-File Format Based on HDF5

In Version 7.3 (R2006b), you can save MAT-files in a format based on HDF5. Unlike earlier MAT-file formats, the HDF5-based format is capable of saving variables that occupy more than 2 GB of storage, including large arrays created on 64-bit systems.

To save a MAT-file in the HDF5-based format, use the -v7.3 option to the MATLAB save function or the "w7.3" mode argument to the C or Fortran matOpen function. The default MAT-file format is the same as that in Version 7.2 (R2006a).

Compatibility Considerations

Earlier versions of MATLAB cannot read MAT-files written in the HDF5-based format.

MAT-files written with MATLAB Version 7.3 (R2006b) on a 64-bit system can be read back into MATLAB 7.3 on a 32-bit system, provided that none of the values stored in the MAT-file require more than 32 bits to store.

-V5 Option to MEX to Be Removed

The -V5 option to mex is not supported in this and future versions of MATLAB.

Compatibility Considerations

You will no longer be able to build a MEX-file that is compatible with MATLAB Version 5.

Location of mex.bat File Changed

In MATLAB Version 7.3, the Microsoft® Windows® script mex.bat is located in the directory $MATLAB\bin.

Compatibility Considerations

You may need to change any scripts or environment variables that relied on the previous location of mex.bat.

Changes to Compiler Support

Compaq® Visual Fortran version 6.1 is supported in Version 7.3 (R2006b) but will not be supported in a future version of MATLAB.

Compatibility Considerations

To ensure continued support for building your Fortran programs, consider upgrading to another supported compiler. For an up-to-date list of supported compilers, see Technical Note 1601: http://www.mathworks.com/support/tech-notes/1600/1601.html.

Actxcontrol Command Now Validates ProgID

Attempting to insert a COM server into a MATLAB figure can result in unpredictable behaviors. To prevent this condition, the actxcontrol command now checks the ProgID by looking at the registry's HKR/CLSID/Control keyword and throws an error if the ProgID does not belong to a Microsoft® ActiveX® control.

Compatibility Considerations

Before the validation check was added, some server ProgIDs worked with actxcontrol , probably because there are cases where Microsoft software points the server GUID to a control GUID underneath. An example of a ProgID that might not work with actxcontrol is the Windows Media® Player server ProgID Mediaplayer.mediaplayer.1. Therefore, depending on how Microsoft software registers the control, the following command might now return an error:

h = actxcontrol('Mediaplayer.mediaplayer.1'); % Returns an error

The correct ProgID to use for Mediaplayer is the ActiveX® control ProgID:

h = actxcontrol('WMPlayer.OCX.7'); % Use control ProgID

Note that methods and properties to open and play files are different when using the control ProgID.

You can disable the validation check with the following command:

feature('COM_ActxProgidCheck',0)

Or reenable it with:

feature('COM_ActxProgidCheck',1)

By default, ProgID checking is on.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS