资源简介
用Matlab实现ISODATA算法对iris数据分类,包括了完整的matlab程序和数据,特别好用。
代码片段和文件信息
function [Z Xcluster Ycluster A cluster] = isodata(X Y k L I ON OC OS NO min);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Parametros interos de la funcion %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
s=size(X);
s=s(2);
cluster=zeros(1s); % Espacio temporal interno de la funcion.
iter=0;
final=0;
vuelve3=0;
A=1; % Lo inicializamos para el primer caso.
primeravez=1; % Para en el primer cilo del while no nos pida la modificacion de parametros.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 1.Inicializacion de los centros %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Z= inicializa_centros(X Y A);
%%%%%%%%%%%%%%%%%%%%%%%%
% Programa principal %
%%%%%%%%%%%%%%%%%%%%%%%%
while final==0 %inicio del bucle de iteraciones.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 2.Establecer los valores de los parametros %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if primeravez==0
if vuelve3==0
[Ltemp Itemp ktemp ONtemp OCtemp OStemp]=parametros(L I k ON OC OS iter);
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 3.Calcula y asigna a cada coordenada {XY} su centro mas cercano %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
primeravez=0;
vuelve3=1;
for i=1:s
cluster(i)=cercano(X(i) Y(i) Z A);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 4.Eliminar agrupamientos %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Funcion que nos reduce (si hace falta) el numero de centros y de agrupamientos encontrados.
[Z A cluster]=eliminar(A cluster Z X Y ON);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 5.Actualiza los centros de los agrupamientos %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Z=recalcula(cluster X Y A Z);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 6.Terminar dividir o mezclar %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if (iter==I)
final=1;
next=0;
else
next=decide78(iter k A);
end;
%%%%%%%%%%%%%%%
% 7.Dividir %
%%%%%%%%%%%%%%%
if next==1
next=2;
hubo_division=0;
A2=A;
divide=0;
% Dispersion por agrupamiento dispersion global
% Y dispersion por variable y componente de maxima dispersion por orden respectivo.
[Di D STM]= dispersion(X Y Z cluster A);
% Division / Divide todos los agrupamientos que cumplan la condicion
i=0; % Si se cumplen las condiciones realiza una division e itera.
while (hubo_division==0) & (i < A) % Si para algun...
i=i+1;
index=find(cluster==i); % Index nos indica los valores del agrupamiento a particionar.
sindex=size(index);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4512 2004-06-15 16:22 dades.mat
文件 18157 2004-06-21 14:08 isodata.m
文件 4059 2004-06-21 01:28 kmedia.m
文件 1358 2004-06-21 14:11 provaisodata.m
文件 600 2004-06-21 01:35 provakmedia.m
- 上一篇:matlab 爱的表白
- 下一篇:RVM分类器及回归 matlab源代码
相关资源
- RVM分类器及回归 matlab源代码
- matlab 爱的表白
- matlab神曲卡农
- matlab人脸识别代码
- 差分方程模型matlab代码
- ID3算法matlab
- 动作能量图
- LMS matlab
- 8阵元均匀圆阵MUSIC DOA算法的matlab程序
- 单片空间后方交会matlab
- topsis matlab 源程序
- 基于MATLAB的模拟退火算法求解最短路
- 放大转发协同通信系统误码率matlab实
- MATLAB信号处理
- 地震波偏移成像matlab
- matlab 仿真程序
- 二维弹性波数值模拟matlab
- 瑞利衰落信道下,采用MRC分集误码性
- 无向图中的最大流算法MATLAB代码
- 基于matlab的简单人脸识别程序代码.
- 人脸识别人眼定位
- ieee30节点
- 卡尔曼滤波与matlab实现
- 混沌神经网络
- CRC编码解码 matlab仿真
- 小波阈值图像去噪,可以matlab运行!
- matlab万年历制作
-
详解MATLAB/Simuli
nk通信系统建模与仿 - 利用MATLAB实现自动曝光
- PCNN分割,边缘提取,图像增强等mat
评论
共有 条评论