project3.m
资源名称:matlab作业.rar [点击查看]
上传用户:miaohui010
上传日期:2013-01-08
资源大小:2540k
文件大小:1k
源码类别:
人工智能/神经网络
开发平台:
Matlab
- load feature_table;
- W=feature_table;
- Dist=pdist(W);
- Tree=linkage(Dist,'ward');
- class=cluster(Tree,3);
- class_1=find(class==1);
- class_2=find(class==2);
- class_3=find(class==3);
- n1=size(class_1);
- n2=size(class_2);
- n3=size(class_3);
- a1=0;a2=0;a3=0;
- for i=1:n1(1)
- if(1000<=class_1(i)<1500)
- a1=a1+1;
- end
- end
- for i=1:n2(1)
- if(500<=class_2(i)<1000)
- a2=a2+1;
- end
- end
- for i=1:n3(1)
- if(0<=class_3(i)<500)
- a3=a3+1;
- end
- end
- err_bg=abs(500-a1)/500
- err_car=abs(500-a2)/500
- err_hm=abs(500-a3)/500