Products & Services Industries Academia Support User Community Company

Learn more about MATLAB   

matPutVariable (C and Fortran) - Write mxArrays to MAT-files

C Syntax

#include "mat.h"
int matPutVariable(MATFile *mfp, const char *name, const mxArray 
  *pm);

Fortran Syntax

integer*4 matPutVariable(mfp, name, pm)
mwPointer mfp, pm
character*(*) name

Arguments

mfp

Pointer to MAT-file information

name

Name of mxArray to put into MAT-file

pm

mxArray pointer

Returns

0 if successful and nonzero if an error occurs. In C, use feof and ferror from the Standard C Library along with matGetFp to determine status.

Description

This routine allows you to put an mxArray into a MAT-file.

matPutVariable writes mxArray pm to the MAT-file mfp. If the mxArray does not exist in the MAT-file, it is appended to the end. If an mxArray with the same name already exists in the file, the existing mxArray is replaced with the new mxArray by rewriting the file. The size of the new mxArray can be different from the existing mxArray.

C Examples

See matcreat.c and matdgns.c in the matlabroot/extern/examples/eng_mat folder for sample programs that illustrate how to use the MAT-file routines in a C program.

See Also

matGetVariable

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

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