C++ class to write HDF5 .mat files.

版本 1.0.0.0 (2.6 KB) 作者: Tim
This is a small C++ class that lets you write matrices, vectors and values to a .mat file.
1.3K 次下载
更新时间 2010/4/23

查看许可证

This is a small C++ class that lets you write matrices, vectors and values to a .mat file. It is simple enough that you can easily modify it yourself.

The mat file format is simply an HDF5 file with a pointless header prepended. This class uses libhdf5 from here:

http://www.hdfgroup.org/HDF5/release/obtain5.html

to write the HDF5 file, and the prepends the header to it. Currently it reads the entire file back in and writes it all out again with the header, because I couldn't get the HDF5 library to append to an existing file. If anyone knows how I'd love to know!

The resulting files can be loaded in matlab using

load('/path/to/file.mat'); % Puts contents in main workspace.
s = load('/path/to/file.mat'); % Puts contents in s structure.

引用格式

Tim (2024). C++ class to write HDF5 .mat files. (https://www.mathworks.com/matlabcentral/fileexchange/27350-c-class-to-write-hdf5-mat-files), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2010a
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0