# matOpen

## Purpose

Open MAT-files.

## C Synopsis

    #include "mat.h"
    MATFile *matOpen(filename,mode)
      char *filename;
      char *mode;

## Fortran Synopsis

    integer*4 function matOpen(filename,mode)
    integer*4 fp
    character*(*) filename, mode

## Arguments

`filename`
  name of file to open
`fp`
  MAT-file handle
`mode`
  file opening mode

## Description

This routine allows you to open MAT-files. In the current implementation, it initializes internal variables and passes through to a standard C `fopen` routine. At a future date, it may initialize the MAT-file with a signature or header.

`matOpen` opens the named file and returns a file handle, or `NULL` if the open fails. Legal values for `mode` are

`r` open file for reading only

`u` open file for update; reading and writing

`w` open file for writing only; delete previous contents, if any

(c) Copyright 1994 by The MathWorks, Inc.