%% Generate FIS Using Subtractive Clustering
% Obtain input and output training data.

load clusterdemo.dat
inputData = clusterdemo(:,1:2);
outputData = clusterdemo(:,3);

%
% Create a genfisOptions option set and specify the range of influence for each data dimension. Specify 0.5 and 0.25 as the range of influence for the first and second input variables. Specify 0.3 as the range of influence for the output data.

opt = genfisOptions('SubtractiveClustering',...
                    'ClusterInfluenceRange',[0.5 0.25 0.3]);

%
% Generate the FIS.

fis = genfis(inputData,outputData,opt);

%
% The generated FIS contains one rule for each cluster.

showrule(fis)

% Copyright 2012 The MathWorks, Inc.