Mat_VarWrite man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

MAT_VARWRITE(3)		 BSD Library Functions Manual	       MAT_VARWRITE(3)

NAME
     Mat_VarWrite — Writes a MATLAB variable to a MATLAB MAT file.

SYNOPSIS
     #include <matio.h>

     int
     Mat_VarWrite(mat_t *mat, matvar_t *matvar,
	 enum matio_compression compress);

DESCRIPTION
     The Mat_VarWrite() function writes the MATLAB variable matvar to the MAT
     file mat which must be opened for writing. If the MAT file is a level 5
     MAT file, the compress option allows the variable to be written using
     zlib compression if available. If compression is not available, the vari‐
     able is written uncompressed.

RETURN VALUES
     The function returns 0 if the variable was successfully written to the
     MAT file.	otherwise, an error value is returned.

EXAMPLES
     This example program creates a MAT file named by the first argument to
     the program, and writes the variable named m_pi to the file.

     #include <math.h>
     #include "matio.h"

     int
     main(int argc,char **argv)
     {
	 mat_t	  *matfp;
	 matvar_t *matvar;
	 size_t	   dims[2] = {1,1};
	 double	   m_pi = M_PI;

	 matfp = Mat_CreateVer(argv[1],NULL,MAT_FT_DEFAULT);
	 if ( NULL == matfp ) {
	     fprintf(stderr,"Error creating MAT file %s0,argv[1]);
	     return EXIT_FAILURE;
	 }

	 matvar = Mat_VarCreate("m_pi",MAT_C_DOUBLE,MAT_T_DOUBLE,2,dims,&m_pi,0);
	 if ( NULL != matvar ) {
	     Mat_VarWrite(matfp,matvar,MAT_COMPRESSION_ZLIB);
	     Mat_VarFree(matvar);
	 }

	 Mat_Close(matfp);
	 return EXIT_SUCCESS;
     }

SEE ALSO
     Mat_CreateVer(3), Mat_Open(3), Mat_VarRead(3)

BSD				March 18, 2012				   BSD
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net