?? find_clusters.m
字號:
function [ind_clust,bgi] = Find_Clusters(dot_dist,mean_dist,num_c,preSet_Centers)%% Clustering Through Ranking On Manifolds% Version 0.2%% Copyright by Markus Breitenbach and Gregory Z. Grudic% This code is for your personal and research use only.%% http://www.cs.colorado.edu/~grudic/% http://ucsu.colorado.edu/~breitenm/%% This software is provided "as is," without warranty of any kind, express% or implied. In no event shall the authors be held liable% for any direct, indirect, incidental, special or consequential damages% arising out of the use of or inability to use this software.%bgi=[];if nargin<4 preSet_Centers=[];end;if length(preSet_Centers) > 2 pp=randperm(length(preSet_Centers)-1); pq=preSet_Centers(2:length(preSet_Centers)); pq=pq(pp); preSet_Centers=[preSet_Centers(1), pq];end;if length(preSet_Centers)==0 m_cls_pt = find(mean_dist == max(mean_dist));else [m_cls_pt, preSet_Centers] = pop(preSet_Centers);end;if length(m_cls_pt)<1 ind_clust=[]; return;end;num_clusters = 1;val_max(num_clusters,1) = mean_dist(m_cls_pt(1));ind_clust(num_clusters,1) = m_cls_pt(1);wt = 1-dot_dist(m_cls_pt(1),:);next_mean = wt.*mean_dist;%figure;plot(next_mean);for num_clusters = 2:num_c if length(preSet_Centers)==0 m_cls_pt = find(next_mean == max(next_mean)); else [m_cls_pt, preSet_Centers] = pop(preSet_Centers); end; val_max(num_clusters,1) = mean_dist(m_cls_pt(1)); ind_clust(num_clusters,1) = m_cls_pt(1); wt = (1-dot_dist(m_cls_pt(1),:)).*wt; next_mean = wt.*next_mean; %figure;plot(next_mean); t5 = 5;end%ind_clust = unique(ind_clust); % remove duplicatesreturn;function [y,X]=pop(X)if length(X)>0 y=X(1); X=X(2:length(X));else y=[];end;return;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -