Documentation Center

  • Trials
  • Product Updates

Contents

Table of MAT-File Source Code Files

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 source code file.

For build information, see:

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:

Was this topic helpful?