Asked • 07/12/19

load .mat file in simulink from python hdf5storage library?

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?

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.