find_temp.m

来自「这是一个改进后的小波聚类的MATLAB源代码」· M 代码 · 共 26 行

M
26
字号
function [temp] = find_temp(tree,handles);
% Selects the temperature.

num_temp=handles.par.num_temp;
min_clus=handles.par.min_clus;

aux =diff(tree(:,5));   % Changes in the first cluster size
aux1=diff(tree(:,6));   % Changes in the second cluster size
aux2=diff(tree(:,7));   % Changes in the third cluster size
aux3=diff(tree(:,8));   % Changes in the third cluster size

temp = 1;         % Initial value

for t=1:num_temp-1;
    % Looks for changes in the cluster size of any cluster larger than min_clus.
    if ( aux(t) > min_clus | aux1(t) > min_clus | aux2(t) > min_clus | aux3(t) >min_clus )    
        temp=t+1;         
    end
end

%In case the second cluster is too small, then raise the temperature a little bit 
if (temp == 1 & tree(temp,6) < min_clus)
    temp = 2;
end    
   

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?