matlabsimulink

ToFile block mat file format


I have set my Matlab (R2019b Update 9) to save Mat files in version 7 because I have a Python script that uses the scipy.io module to load mat files and v7.3 format is not supported by this Python module. Manually saved mat files from Matlab workspace variables are created in format v7, however mat files created from Simulink ToFile blocks seem not to use that format as when I run my script on such mat files I encounter the error below:

NotImplementedError: Please use HDF reader for matlab v7.3 files

How to enforce ToFile blocks to use v7 format?


Solution

  • I solved this issue by rewriting a script that reads the v7.3 Mat file format using the h5py Python module.