function [] = cluster_FUN()
%CLUSTER_FUN Summary of this function goes here
% Detailed explanation goes here
set(0,'RecursionLimit',1000);
X=xlsread('X.xlsx');
BX=zscore(X); %标准化数据矩阵
Y=pdist(X) %用欧氏距离计算两两之间的距离
D=squareform(Y) %欧氏距离矩阵
Z=linkage(Y,'single') %最短距离法
T=cluster(Z,9) %等价于 {T=clusterdata(X,3)}
%find(T==3) %第3 类集合中的元素
[H,T]=dendrogram(Z) %画聚类图
end
matlab自带的聚类算法
1星 需积分: 34 191 浏览量
2014-02-09
11:07:45
上传
评论 1
收藏 522B RAR 举报
ruoxiliankong
- 粉丝: 0
- 资源: 14