Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python how to write array into matlab file

from scipy.io import savemat
>>> a = np.arange(20)
>>> mdic = {"a": a, "label": "experiment"}
>>> mdic
{'a': array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
    17, 18, 19]),
'label': 'experiment'}
>>> savemat("matlab_matrix.mat", mdic)
Source by docs.scipy.org #
 
PREVIOUS NEXT
Tagged: #python #write #array #matlab #file
ADD COMMENT
Topic
Name
1+2 =