⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 isodata1.m

📁 模式识别中的isodata算法
💻 M
字号:
%**** ISODATA classification algorithm simulation ****%
% Author: Feng Shuo
% Student ID: 1030520508
% Date 2007.04.15 %special day for me.......
% 2007.04.19 updated
clc;
clear;


%% Initializing %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ----------------------------------
% number of classes desired
K=2; 
% minimum number of samples in a class
theta_n=1;
% standard variance of a class(control split.The smaller theta_s is, the easier to split)
theta_s=1;
% minimum distance of two class centers(control split. The smaller theta_c is, the easier to combine)
theta_c=4;
% maximum combined classes each iteration
L=1;
% maximum allowed iteration times 
I=4;
J=1;
% ----------------------------------
% sample,point coordinate ig.(x,y)
sample=[0 0;1 1;2 2;4 3;4 4;5 3;5 4;6 5;];
%%Initializing finished%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%% ISODATA Algorithm Start %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ------------------------------------
% All important data in (cell) array s.
% See more details in step2.m

% Step 1.-----------------------------
% original number of classes
c=1;
% original class center
z=[0 0]; % start center/centers, choose any point as you wish
% actual center in every iteration
Z=z;

while J<=I

                  %%%%%%%%%%%%%%%%%%%%%%%
                  % Step 2.-----------------------------
                  % stript step2.m
                  step2;

                  % Step 3.-----------------------------
                  % if sample number of a class is less than theta_n
                  step3;

                  % Step 4.5.6. ------------------------
                  % Finished in Step 2

                  % Step 7------------------------------
                  if J>=I
                     theta_c=0;
                     step11
                     else 
                        if c<=K/2
                           step8
                           else 
                              if (c>=2*K)|(mod(J,2)==0)
                                 step11
                              else
                                 step8
                              end
                        end
                  end
                  %%%%%%%%%%%%%%%%%%%%%%%

end
%%ISODATA Algorithm Finished %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%Simulation END%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% figure, give out the pictures
fig_isodata;

%%%Author: Feng Shuo%%%%%%%%

⌨️ 快捷键说明

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