| MATLAB® | ![]() |
#include "mat.h" int matPutVariable(MATFile *mfp, const char *name, const mxArray *pm);
integer*4 matPutVariable(mfp, name, pm) mwPointer mfp, pm character*(*) name
Pointer to MAT-file information
Name of mxArray to put into MAT-file
mxArray pointer
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.
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.
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.
![]() | matOpen (C and Fortran) | matPutVariableAsGlobal (C and Fortran) | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |