When load matrices from mat file in python using scipy.io, it makes dictionary where key is name of matrix,and value is 2D array of that matrix.
How can i access elements in this array?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Suppose you have
Then you can see which matrices were loaded by
For each key
keyin the dictionary, you can retrieve the corresponding matrix bymy_matrixis a 2d array representing the matrix. So to get row 0 of the matrix, you would usemy_matrix[0], and to get element(0,0) of the matrix, you would usemy_matrix[0][0].Here’s a nice tutorial you can use for other basic functionality.