load .mat file in simulink from python hdf5storage library

351 Views Asked by At

I am trying to load/read some random data in simulink I created using the Python module hdf5storage.

I created .mat file in Python (simulink supports version 7.3 only) using this code:

# get code on https://pypi.python.org/pypi/hdf5storage/0.1.3
import hdf5storage
import numpy as np

matcontent = {}
matcontent[u'some_numbers'] = np.array([10, 50, 20]) # each key must be a   unicode string

hdf5storage.write(matcontent, '.', 'data.mat', matlab_compatible=True)

I can load the written file in matlab but not in simulink giving the error:

Caused by:

Simulink does not support loading the input data in the variable 'bar' in file 'C:......\6D\data.mat'. The From File block can only load MATLAB timeseries objects, structures of MATLAB timeseries objects, or two-dimensional arrays consisting of one-dimensional, double, non-complex samples.

It says I have to create timeseries objects but how to create it in python?

0

There are 0 best solutions below