Skip to content
Novus Examples
h54.8 KB

MATLAB v7.3 (.mat) Variable Store — the HDF5 File It Actually Is (.h5)

A MATLAB v7.3 variable store, which is an HDF5 file with a 512-byte MATLAB user block and MATLAB_class attributes — the bytes are the same whichever extension you give it. Because MATLAB is column-major, A appears in HDF5 as its own transpose, which is the conversion bug this fixture is built around.

Preview — schema + first 4 rowsh5
VariableMATLAB_classMATLAB shapeHDF5 shape
Adouble3 x 4(4, 3) — transposed
Bdouble2 x 2(2, 2)
flaglogical1 x 1(1, 1) uint8 with MATLAB_int_decode = 1
namechar1 x 9(9, 1) uint16 with MATLAB_int_decode = 2
Bytes 0-511 are the MATLAB user block; the HDF5 superblock starts at offset 512.

Specifications

Matlab Version
v7.3
Container
HDF5 with a 512-byte user block
Variables
A (3x4 double), B (2x2 double), flag (logical), name (char)
Storage Order
column-major, so arrays appear transposed in HDF5
User Block Bytes
512
Signature At
offset 0
Extension Note
identical bytes; rename to .mat to open in MATLAB

Testing contract

Expected to pass
Scenario
Open the file as HDF5, read variable A with its MATLAB_class attribute, and transpose it back to MATLAB orientation.
Expected result
The first 512 bytes are the MATLAB user block and the HDF5 superblock starts at offset 512; A reads as shape (4, 3) with MATLAB_class 'double' and transposes to the 3x4 matrix 1..12 in row-major order.

What is a .h5 file?

HDF5 (.h5) is a binary container format for large, heterogeneous scientific data. It stores multidimensional arrays (datasets) in a hierarchical group structure with attributes and chunked, compressed storage, and is standard in ML, physics, and geoscience.

How to use this file

Use an example .h5 file to test HDF5 readers (h5py, PyTables), group and dataset traversal, and attribute extraction.

How to use this file for testing

“MATLAB v7.3 (.mat) Variable Store — the HDF5 File It Actually Is (.h5)” is a deterministic Novus Examples fixture for Scientific data, Serialization testing, Conversion testing. Citation catalogs (BibTeX, RIS), chemistry structures (MDL Molfile, PDB), and gridded binary data (NetCDF, FITS) — for testing reference managers, molecule viewers, and scientific-data loaders.

Documented properties for this file: H5 · 4,880 bytes. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Scientific fixtures are small, valid, and fully synthetic — no real organism, patient, sample, or observation. Point your parser or loader at the file and check it reads the documented records, variables, or headers; binary formats ship a readable twin or metadata listing for comparison.

Generated by generation/scientific.py. Free for any use, no attribution required — license.