1MAT_CREATEVER(3) BSD Library Functions Manual MAT_CREATEVER(3)
2
4 Mat_CreateVer, Mat_Create — Creates a MATLAB MAT file.
5
7 #include <matio.h>
8
9 mat_t *
10 Mat_CreateVer(const char *matname, const char *hdr_str,
11 enum mat_ft mat_file_ver);
12
13 mat_t *
14 Mat_Create(const char *matname, const char *hdr_str);
15
17 The Mat_CreateVer() function creates a MATLAB MAT file opened for write
18 access. The hdr_str is a string written in the file header of MAT ver‐
19 sion 5 and 7.3 (HDF) files. Only the first 128 bytes of the string is
20 written. If hdr_str is NULL, then a default string is written that con‐
21 tains the platform, date, matio library version.
22
23 The mat_file_ver argument specifies the MAT file version to create. The
24 matio library can write version 5 files (MAT_FT_MAT5), and an HDF5 file
25 format introduced in MATLAB version 7.3 (MAT_FT_MAT73).
26
27 The Mat_Create() function is equivalent to calling Mat_CreateVer() with
28 MAT_FT_DEFAULT as the file version.
29
31 #include <stdlib.h>
32 #include <stdio.h>
33 #include "matio.h"
34
35 int main(int argc,char **argv)
36 {
37 mat_t *matfp;
38
39 matfp = Mat_CreateVer(argv[1],NULL,MAT_FT_73);
40 if ( NULL == matfp ) {
41 fprintf(stderr,"Error creating MAT file %s0,argv[1]);
42 return EXIT_FAILURE;
43 }
44
45 Mat_Close(matfp);
46 return EXIT_SUCCESS;
47 }
48
49
51 Mat_CreateVer(3), Mat_Close(3)
52
53BSD March 25, 2019 BSD