Table of MAT-File Source Code Files - MATLAB & Simulink (original) (raw)
Main Content
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®, macOS, and Linux® systems.
To build a code example, first copy the file to a writable folder, such asc:\work
on your Windows path.
copyfile(fullfile(matlabroot,'extern','examples','eng_mat',... 'filename'), fullfile('c:','work'))
where filename
is the name of the source code file.
For build information, see:
- MAT-File API Library and Include Files
- Build on macOS and Linux Operating Systems
- Build on Windows Operating Systems
Example | Description |
---|---|
matcreat.c | C program that demonstrates how to use the library routines to create a MAT-file that you can load into MATLAB®. |
matcreat.cpp | C++ version of the matcreat.c program. |
matdgns.c | C program that demonstrates how to use the library routines to read and diagnose a MAT-file. |
matdemo1.F | Fortran program that demonstrates how to call the MATLAB MAT-file functions from a Fortran program. |
matdemo2.F | Fortran program that demonstrates how to use the library routines to read the MAT-file created by matdemo1.F and describe its contents. |
matimport.c | C program based on matcreat.c used in the example for writing standalone applications. |
matreadstructarray.c | C program based on explore.c to read contents of a structure array. |
matreadcellarray.c | C program based on explore.c to read contents of a cell array. |
For examples using the Matrix Library, see:
- Tables of MEX Function Source Code Examples.
- The
explore.c
example described in Using Data Types.