-
Notifications
You must be signed in to change notification settings - Fork 0
/
Hierarchical_ERP.m
31 lines (24 loc) · 1.6 KB
/
Hierarchical_ERP.m
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
% --------------------Hirerichal Clustering ERP data ------------------
% The ERP data has well structure for clustering time sammples and
% channnels 500x58 we applied Matlab clustering function on this dataset
function [H_ERP]=Hierarchical_ERP(ERP_Subj,Subj,k,G);
for g=1:G
for s=1:Subj % subjects
x=squeeze(ERP_Subj(:,:,s,g));
% clustering with diferent similarity functions---------------------------
% cl=clusterdata(x,'linkage','complete','distance','euclidean','maxclust',k);
% cl=clusterdata(x,'linkage','complete','distance','seuclidean','maxclust',k);
% cl=clusterdata(x,'linkage','complete','distance','cityblock','maxclust',k);
% cl=clusterdata(x,'linkage','complete','distance','minkowski','maxclust',k);
% cl=clusterdata(x,'linkage','complete','distance','chebychev','maxclust',k);
% cl=clusterdata(x,'linkage','complete','distance','mahalanobis','maxclust',k);
% cl=clusterdata(x,'linkage','complete','distance','cosine','maxclust',k);
cl=clusterdata(x,'linkage','complete','distance','correlation','maxclust',k);
% cl=clusterdata(x,'linkage','complete','distance','spearman','maxclust',k);
% cl=clusterdata(x,'linkage','complete','distance','hamming','maxclust',k);
% cl=clusterdata(x,'linkage','complete','distance','jaccard','maxclust',k);
H_ERP(:,s,g)=cl;
end
end
end
%----------------- The end of Hierarchical clustering ---------------------