1MAT_CREATEVER(3)         BSD Library Functions Manual         MAT_CREATEVER(3)
2

NAME

4     Mat_CreateVer, Mat_Create — Creates a MATLAB MAT file.
5

SYNOPSIS

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

DESCRIPTION

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 4 files (MAT_FT_MAT4), version 5 files
25     (MAT_FT_MAT5), and an HDF5 file format introduced in MATLAB version 7.3
26     (MAT_FT_MAT73).
27
28     The Mat_Create() function is equivalent to calling Mat_CreateVer() with
29     MAT_FT_DEFAULT as the file version.
30

EXAMPLES

32     #include <stdlib.h>
33     #include <stdio.h>
34     #include "matio.h"
35
36     int main(int argc, char **argv)
37     {
38         mat_t *matfp;
39
40         matfp = Mat_CreateVer(argv[1], NULL, MAT_FT_73);
41         if ( NULL == matfp ) {
42             fprintf(stderr, "Error creating MAT file %s0, argv[1]);
43             return EXIT_FAILURE;
44         }
45
46         Mat_Close(matfp);
47         return EXIT_SUCCESS;
48     }
49
50

SEE ALSO

52     Mat_CreateVer(3), Mat_Close(3)
53
54BSD                           September 12, 2019                           BSD
Impressum