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 |
|
Libraries |
| |
Examples |
| |
macOS
| Include files |
|
Libraries |
| |
Examples |
|
The
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:matlabroot
\extern\include
mat.h
— Function prototypes for mat
routines
matrix.h
— Definitions of the mxArray
structure
and function prototypes for matrix access routines
The name of the libraries folder, which contains the shared (dynamically linkable) libraries, is platform-dependent.
The bin
folder contains the run-time version of the shared
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
The bin/
folder, where
arch
arch
is the value returned by the
computer('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
The bin/
folder, where
arch
arch
is the value returned by the
computer('arch')
command, contains the shared libraries. For
example, on Apple
macOS 64-bit systems, the folder is bin/maci64
:
MAT-File library —
matlabroot
/bin/maci64/libmat.dylib
Matrix library —
matlabroot
/bin/maci64/libmx.dylib
MEX library (optional) —
matlabroot
/extern/bin/maci64/libmex.dylib
The extern/examples/eng_mat
folder contains C/C++ and Fortran source
code for examples demonstrating how to use the MAT-file routines.