%% Obtain ANFIS Step Size Profile
% Create single-input, single-output training data.

x = (0:0.1:10)';
y = sin(2*x)./exp(x/5);

%
% Configure the ANFIS training options. Set the initial FIS, and suppress the training progress display.

opt = anfisOptions('InitialFIS',4,'EpochNumber',60);
opt.DisplayANFISInformation = 0;
opt.DisplayErrorValues = 0;
opt.DisplayStepSize = 0;
opt.DisplayFinalResults = 0;

%
% A larger step size increase rate can make the training converge faster. However, increasing the step size increase rate too much can lead to poor convergence. For this example, try doubling the step size increase rate.

opt.StepSizeIncreaseRate = 2*opt.StepSizeIncreaseRate;

%
% Train the FIS, and return the step size array.

[fis,~,stepSize] = anfis([x y],opt);

%
% Plot the step size profile. An optimal step size profile should increase initially, reach a maximum, and then decrease for the rest of the training.

figure
plot(stepSize)

% Copyright 2012 The MathWorks, Inc.