-
Notifications
You must be signed in to change notification settings - Fork 0
/
Hierarchical_GAERP.m
34 lines (25 loc) · 1.53 KB
/
Hierarchical_GAERP.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
32
33
34
% --------------------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_GAERP(x,k)
% x is grand average data e.g. 4800 (observation )x30 (feature)
% % 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=cl;
% % end
% % end
end
%----------------- The end of Hierarchical clustering ---------------------