checkcl.m

来自「聚类分析工具箱 亚历山大博士写的」· M 代码 · 共 26 行

M
26
字号
% function cl = checkcl(cl)
%
% DESCRIPTION
%   Checks a cluster labeling for validity and fixes
%   detected problems
%
% Copyright (c) 1998-2002 by Alexander Strehl


function cl = checkcl(cl)

if ~isempty(cl),
   if min(cl)<=0,
      disp('checkcl: non-positive values in cl');
      cl = cl-min(cl)+1;
      disp('checkcl: offset to minimum 1');   
   end;
   if max(cl) ~= max(onetomax(cl)),
      disp('checkcl: not a dense integer mapping');
      cl = onetomax(cl);
      disp(['checkcl: remapped to 1 to ' num2str(max(cl))]);
   end;
else
   disp('checkcl: empty clustering');
end;

⌨️ 快捷键说明

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