Is it possible to add a new variable to a .mat file (v7.3) using the Python package hdf5storage?
Example:
I wrote in Matlab:
test = {'Hello', 'world!'; 'Good', 'morning'; 'See', 'you!'};
save('data.mat', 'test', '-v7.3') % v7.3 so that it is readable by h5py
In Python I would like to add a new variable to data.mat
. How can I do so, to achieve something like:
I tried:
import hdf5storage # get code on https://pypi.python.org/pypi/hdf5storage/0.1.3
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)
but it overwrites data.mat
instead of adding a new variable.