BCI数据处理之———scipy.io读取mat类型数据

因为要对脑电信号进行处理,记录下来方便查看。BCI Competition 公开数据源下载数据集,使用python加载mat文件

import scipy.io as sio
import numpy as np
import matplotlib.pyplot as plt

data=sio.loadmat('EEG-Data/dataset_BCIcomp1.mat')

x_train=data['x_train']
x_test =data['x_test']
y_train=data['y_train']

plt.figure(1)
plt.plot(x_train[:,0,0])
plt.figure(2)
plt.plot(x_train[:,1,0])
plt.figure(3)
plt.plot(x_train[:,2,0])
plt.show()

print (x_train.shape)
print (x_test.shape)
print (y_train.shape)

数据集包含3个字段,x_train、x_test、y_train


你可能感兴趣的:(BCI)