| MATLAB Application Program Interface | Search  Help Desk |
| matPutMatrix | Examples |
Writes mxArrays into MAT-files
Fortran Syntax
integer*4 function matPutMatrix(mfp, mp) integer*4 mp, mfp
Arguments
mfp
mp
mxArray pointer.
Description
This routine allows you to put anmxArray into a MAT-file.
matPutMatrix writes mxArray mp 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 than the existing mxArray.
matPutMatrix returns 0 if successful and nonzero if an error occurs.
Be careful in your code to free the mxArray created by this routine when you are finished with it.
Example
Seematdemo1.f in the eng_mat subdirectory of the examples directory for a sample program that illustrates how to use this MAT-file routine in a Fortran program.