MAT-File API Library and Include Files - MATLAB & Simulink (original) (raw)
Main Content
MATLAB® provides include and library files to write programs to read and write MAT-files. The following table lists the path names to these files. The term_matlabroot
_ refers to the root folder of your MATLAB installation. The term arch
is a unique string identifying the platform.
MAT-File API Folders
Platform | Contents | Folder |
---|---|---|
Microsoft® Windows® | Include files | _matlabroot_\extern\include |
Libraries | _matlabroot_\bin\win64 | |
Examples | _matlabroot_\extern\examples\eng_mat | |
macOS Linux® | Include files | matlabroot/extern/include |
Libraries | matlabroot/bin/arch | |
Examples | matlabroot/extern/examples/eng_mat |
MAT-File API Include Files
The _`matlabroot`_\extern\include
folder holds header files containing function declarations with prototypes for the routines that you can access in the API Library. These files are the same for Windows, macOS, and Linux systems. The folder contains:
mat.h
— Function prototypes format
routinesmatrix.h
— Definitions of themxArray
structure and function prototypes for matrix access routines
MAT-File API Libraries
You need the libmat
and libmx
shared libraries. The name of the file is platform-specific.
Import Libraries on Windows Systems
The lib
folder contains the import libraries:
- MAT-File library —
_`matlabroot`_\extern\lib\win64\_`compiler`_\libmat.lib
- Matrix library —
_`matlabroot`_\extern\lib\win64\_`compiler`_\libmx.lib
- MEX library (optional) —
_`matlabroot`_\extern\lib\win64\_`compiler`_\libmex.lib
Shared Libraries on Linux Systems
The bin/_`arch`_
folder, where_arch
_ is the value returned by thecomputer('arch')
command, contains the shared libraries.
- MAT-File library —
_`matlabroot`_/bin/glnxa64/libmat.so
- Matrix library —
_`matlabroot`_/bin/glnxa64/libmx.so
- MEX library (optional) —
_`matlabroot`_/extern/bin/glnxa64/libmex.so
Shared Libraries on macOS Systems
The bin/_`arch`_
folder, where_arch
_ is the value returned by thecomputer('arch')
command, contains the shared libraries. For example, on Apple macOS 64-bit systems, the folder is bin/maci64
:
- MAT-File library —
_`matlabroot`_/bin/_`macos`_/libmat.dylib
- Matrix library —
_`matlabroot`_/bin/_`macos`_/libmx.dylib
- MEX library (optional) —
_`matlabroot`_/extern/bin/_`macos`_/libmex.dylib
Example Files
The extern/examples/eng_mat
folder contains C/C++ and Fortran source code for examples demonstrating how to use the MAT-file routines.