function cluster = dbscan(M, Eps, MinPts) cluster = zeros(size(M,1),1); classcounter = 0; doLoop = 1; while(doLoop) classcounter = classcounter + 1; notClassified = find(cluster == 0); if(sum(notClassified) == 0) doLoop = 0; else cluster(notClassified(1)) = classcounter; cluster = dbrec(notClassified(1), M, Eps, MinPts, cluster); end end antal(max(cluster)) = 0; for i = 1:size(M,1) antal(cluster(i)) = antal(cluster(i)) + 1; end temp = find(antal <= 5); for i = 1:size(temp) cluster(temp(i end cluster(find(cluster == find(antal <= 5))) = 0