Skip to content

Instantly share code, notes, and snippets.

@kkt-ee
Created September 20, 2020 07:57
Show Gist options
  • Save kkt-ee/eb24bfde8fc26c17859a5f329bd9b53c to your computer and use it in GitHub Desktop.
Save kkt-ee/eb24bfde8fc26c17859a5f329bd9b53c to your computer and use it in GitHub Desktop.
load a .mat file in python
from scipy.io import loadmat
IMFs = loadmat('IMFData_.mat')
# -----< INSPECTING IMFData_ >
type(IMFs['IMFData_']),IMFs['IMFData_'].shape
IMFData_ = IMFs['IMFData_'] #numpy.ndarray
IMFData_.dtype
IMFData_.shape # IMFData_ : {2Darray, string} x 200 instances
IMFData_[0].shape # 0-199(max)
IMFData_[199][0].shape # [199th signal][0]---< all 7 IMFs >
IMFData_[199][0][:,0] # max [:,6] -----< one IMF > ********************
IMFData_[199][0][:,0].shape
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment