Search
 
SCRIPT & CODE EXAMPLE
 

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)
Comment

PREVIOUS NEXT
Code Example
Python :: Merge 2 or more notebooks into one 
Python :: rename last layer of keras model 
Python :: how draw shell in python 
Python :: cursor python 
Python :: how to create tupple in python 
Python :: extract specific key values from nested dictionary 
Python :: display column names as a dictionary pandas 
Python :: NumPy resize Syntax 
Python :: python toupls 
Python :: number length python 
Python :: how to comment python 
Python :: df max count syntax 
Python :: input a number and print even numbers up to that number in python 
Python :: update dataframe based on value from another dataframe 
Python :: newtorkx remove node 
Python :: pandas check length of string 
Python :: staticmethod vs classmethod python 
Python :: pytest for loop 
Python :: setup mongodb database with django 
Python :: python - extract min and max values per each column name 
Python :: qt designer python 
Python :: how to get the top 100 frequent words on a python dataframe colummn 
Python :: .dropna() python 
Python :: python unittest multiple test cases 
Python :: how to add string in csv in python 
Python :: create a dict from two lists 
Python :: how to display items on a list on new lines python 
Python :: DecisionTreeClassifier 
Python :: python default value 
Python :: how to get last dimension of an array python 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =