MAT_CREATEVER(3)
π NAME π
Mat_CreateVer, Mat_Create β bestie, this is the one that creates a MATLAB MAT file. New file, fresh start, main character origin story. β¨
πΈ SYNOPSIS πΈ
#include <matio.h>
mat_t *
Mat_CreateVer(const char *matname, const char *hdr_str,
enum mat_ft mat_file_ver);
mat_t *
Mat_Create(const char *matname, const char *hdr_str);
π¦ DESCRIPTION π¦
Okay so. Mat_CreateVer() makes a MATLAB MAT file and opens it up for write access. Periodt. π
The hdr_str is a string that gets written into the file header of MAT version 5 and 7.3 (HDF) files. Heads up though β only the first 128 bytes of that string actually make it in, so don't write a novel in there, bestie. π If hdr_str is NULL, a default string gets written instead, and that default one contains the platform, the date, and the matio library version. Cute little auto-signature, love that for it.
Now, the mat_file_ver argument is the one telling everybody which MAT file version you're creating. And the matio library can write:
- version 4 files β that's
MAT_FT_MAT4 - version 5 files β that's
MAT_FT_MAT5 - and an HDF5 file format that was introduced in MATLAB version 7.3 β that's
MAT_FT_MAT73
And then there's Mat_Create() β it's literally just Mat_CreateVer() but with MAT_FT_DEFAULT as the file version. Same energy, fewer arguments. π«Ά
β EXAMPLES β
#include <stdlib.h>
#include <stdio.h>
#include "matio.h"
int main(int argc, char **argv)
{
mat_t *matfp;
matfp = Mat_CreateVer(argv[1], NULL, MAT_FT_73);
if ( NULL == matfp ) {
fprintf(stderr, "Error creating MAT file %s0, argv[1]);
return EXIT_FAILURE;
}
Mat_Close(matfp);
return EXIT_SUCCESS;
}
π SEE ALSO π
okay that's the whole page, you ate that π This one's from the Debian crew, dated September 12, 2019, and it's page MAT_CREATEVER(3) of the Library Functions Manual. Now go forth and create some files, icon. ππ
π¦ where this page comes from
- arch rolling: libmatio 1.5.30-1 Β· BSD-2-Clause
- fedora 44: matio-devel 1.5.30-2.fc44 Β· BSD-2-Clause
- fedora 44: matio-devel 1.5.30-2.fc44 Β· BSD-2-Clause
- nixpkgs unstable: matio 1.5.30
- ubuntu resolute: libmatio-doc 1.5.30-2 Β· BSD-2-Clause
- ubuntu stonking: libmatio-doc 1.5.30-4build1 Β· BSD-2-Clause
- Copyright (c) 2015-2026, The matio contributors
- Copyright (c) 2011-2014, Christopher C. Hulbert
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms