Problems with Matlab Projects? You may face many Problems, but do not worry we are ready to solve your Problems. All you need to do is just leave your Comments. We will assure you that you will find a solution to your project along with future tips. On Request we will Mail you Matlab Codes for Registered Members of this site only, at free service...Follow Me.

Reading and writing .mat files with Python

If you have some old data, or find some interesting data set online, stored in Matlab's .mat file format it is possible to read this using the scipy.io module inSciPy. This is how to do it.

data = scipy.io.loadmat('test.mat')

"data" now contains a dictionary with keys corresponding to the variable names saved in the original .mat file. The variables are in array format. Saving to .mat files is equally simple. Just create a dictionary with all variables you want to save and use savemat().
data = {}
data['x'] = x
scipy.io.savemat('test.mat',data)

This saves the array x so that it has the name "x" when read into Matlab. More information on scipy.io can be found in the online documentation.

0 comments:

Post a Comment

Recent Comments

Popular Matlab Topics

Share your knowledge - help others

Crazy over Matlab Projects ? - Join Now - Follow Me

Sites U Missed to Visit ?

Related Posts Plugin for WordPress, Blogger...

Latest Articles

Special Search For Matlab Projects

MATLAB PROJECTS

counter

Bharadwaj. Powered by Blogger.