The matlabroot/extern/examples/eng_mat folder contains C/C++ and Fortran source code for examples demonstrating how to use the MAT-file routines. These examples create standalone programs. The source code is the same for both Windows® and UNIX® systems.
To build a code example, first copy the file to a writable folder, such as c:\work, on your Windows path:
copyfile(fullfile(matlabroot,'extern','examples','eng_mat',... 'filename'), fullfile('c:','work'));
where filename is the name of the example.
Make sure that you have a compiler selected using the mex -setup command.
For build information, see:
C program that demonstrates how to use the library routines to create a MAT-file that you can load into MATLAB®.
C++ version of the matcreat.c program.
C program that demonstrates how to use the library routines to read and diagnose a MAT-file.
Fortran program that demonstrates how to call the MATLAB MAT-file functions from a Fortran program.
Fortran program that demonstrates how to use the library routines to read the MAT-file created by matdemo1.F and describe its contents.
C program based on matcreat.c used in the example for writing standalone applications.
C program based on explore.c to read contents of a structure array.
C program based on explore.c to read contents of a cell array.
These examples illustrate the MAT-File API functions. For examples using the MX Matrix Library, see: