Code covered by the BSD License  

Highlights from
Fuzzy C-Means with Focal Point

image thumbnail

Fuzzy C-Means with Focal Point

by

 

We present a generalization of partitional clustering.

distfcmfp(center, data)
function out = distfcmfp(center, data)
%DISTFCMFP Distance measure in fuzzy c-mean clustering with focal point.
%	OUT = DISTFCMFP(CENTER, DATA) calculates the Euclidean distance
%	between each row in CENTER and each row in DATA, and returns a
%	distance matrix OUT of size M by N, where M and N are row
%	dimensions of CENTER and DATA, respectively, and OUT(I, J) is
%	the distance between CENTER(I,:) and DATA(J,:).
%
%       See also FCMFPDEMO, INITFCM, IRISFCM, STEPFCMFP, ITERFCMFP, and FCMFP.

%	Roger Jang, 11-22-94, 6-27-95.
%       Copyright 1994-2002 The MathWorks, Inc. 
%       $Revision: 1.13 $  $Date: 2002/04/14 22:20:29 $

%	Silvio Filipe, 31-08-2011.
%       $Revision: 2.00 $  $Date: 2011/08/31 $

out = zeros(size(center, 1), size(data, 1));

% fill the output matrix
if size(center, 2) > 1,
    for k = 1:size(center, 1),
        out(k, :) = sqrt(sum(((data-ones(size(data, 1), 1)*center(k, :)).^2)'));
    end
else	% 1-D data
    for k = 1:size(center, 1),
        out(k, :) = abs(center(k)-data)';
    end
end

Contact us