External Interfaces/API Reference Previous page   Next Page
matOpen

Opens a MAT-file

C Syntax

Arguments

filename
   Name of file to open.

mfp
   Pointer to MAT-file information.

mode
   File opening mode. Legal values for mode are:

Table 1-1:
r
Opens file for reading only; determines the current version of the MAT-file by inspecting the files and preserves the current version.
u
Opens file for update, both reading and writing, but does not create the file if the file does not exist (equivalent to the r+ mode of fopen); determines the current version of the MAT-file by inspecting the files and preserves the current version.
w
Opens file for writing only; deletes previous contents, if any.
w4
Creates a MATLAB 4 MAT-file.

Description

This routine allows you to open MAT-files for reading and writing.

matOpen opens the named file and returns a file handle, or NULL if the open fails.

Examples

See matcreat.c and matdgns.c in the eng_mat subdirectory of the examples directory for sample programs that illustrate how to use the MATLAB MAT-file routines in a C program.


Previous page  matGetVariableInfo matPutArray (Obsolete) Next page

Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS