-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTrain_data.m
More file actions
48 lines (35 loc) · 915 Bytes
/
Train_data.m
File metadata and controls
48 lines (35 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
clear; close all; clc;
% Addressing
path_data='D:\EEG\Final_report\Prep_Data\';
data_norm='_norm.mat';
data_dis='_dis.mat';
% Data Preparation
norm=[];
dis=[];
%Brain Freqs
u=[61 64];
l=[57 60];
% Load training data
for i=1:132 % 132 of 132 normal
subj=num2str(i);
name_norm=strcat(subj,data_norm);
address_norm=strcat(path_data,name_norm);
load(address_norm)
norm=[norm; bandpower(final_eeg,512,u)./bandpower(final_eeg,512,l)];
i
end
for i=1:196 % 196 of 196 disorder ( because of rectangular matrix)
subj=num2str(i);
name_dis=strcat(subj,data_dis);
address_dis=strcat(path_data,name_dis);
load(address_dis);
dis=[dis; bandpower(final_eeg,512,u)./bandpower(final_eeg,512,l)];
i
end
dis=dis';
norm=norm';
T_norm=[zeros(1,132)];
T_dis=[ones(1,196)];
x=[norm dis];
t=[T_norm, T_dis]; %labels
Train=[x;t];