资源简介
DBSCAN算法MATLAB源代码。利用此份源代码,可以轻松实现对于点云数据的密度聚类
代码片段和文件信息
function [IDXisnoise] = DBSCAN(DataRadiusMinPts)
%
% Syntax: [IDXisnoise] = DSCAN(DataRadiusMinPts)
%
Cluster_Num = 0;
Num = size(Data1);
IDX = zeros(Num1);
Distance = pdist2(Data(:1:2)Data(:1:2));
visited = false(Num1);
isnoise = false(Num1);
% DBSCAN 密度聚类
for index_i = 1:Num
if ~visited(index_i)
visited(index_i) = true;
Neighbors = find(Distance(index_i:)<=Radius&Distance(index_i:)>0);%此处返回的为行向量
if numel(Neighbors) isnoise(index_i) = true;
else
Cluster_Num = Cluster_Num + 1;
IDX(index_i) = Cluster_Num;
% 寻找index_i周围邻近点
index_j = 1;
while true
if ~v
- 上一篇:自适应均衡(LMS算法)
- 下一篇:用逼近法计算不完全贝塔函数的值
评论
共有 条评论