Skip to content

Instantly share code, notes, and snippets.

@mtakemiya
Created April 26, 2012 03:48
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtakemiya/2495641 to your computer and use it in GitHub Desktop.
Save mtakemiya/2495641 to your computer and use it in GitHub Desktop.
Reading .mat File in Python
import h5py
f = h5py.File('fileName.mat')
fileHeader = f['fileInfo']
data = f['chData']
dataHeaders = f['chHeader']
numChannels = len(data)
ch1 = data['ch1']
ch2 = data['ch2']
@mtakemiya
Copy link
Author

This is an example of how to read .mat files from http://brainliner.jp, but this is somewhat applicable for any .mat files saved using the v7.3 format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment