Write C Programs to Read MAT File Data - MATLAB & Simulink (original) (raw)
Main Content
Read and write MATLABĀ® data from C programs, using mxArray
When you program your entire application in MATLAB or when you share data with other MATLAB users, use these MATLAB procedures.
- To bring data into a MATLAB application, use Supported File Formats for Import and Export.
- To save data to a MAT file, use Save and Load Workspace Variables.
There are situations, however, when you must write a custom program to interact with data. For example:
- Your data has a custom format.
- You create applications for users who do not run MATLAB, and you want to provide them with MATLAB data.
- You want to read data from an external application, but you do not have access to the source code.
C MAT File API
Topics
- Table of MAT-File Source Code Files
Thematlabroot
/extern/examples/eng_mat
folder contains C/C++ and Fortran source code for examples demonstrating how to use the MAT-file routines. - Create Custom Programs to Read MAT-Files
Methods for importing and exporting MATLAB data with MAT-file functions usingmxArray
. - Share MAT-File Applications
MATLAB requires shared library files for building a MAT-file application.