%% Obtain ANFIS Training Error
% Load training data. This data has a single input and a single output.

load fuzex2trnData.dat

%
% Specify the training options.

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

%
% Train the FIS, and return the training error.

[fis,trainError] = anfis(fuzex2trnData,opt);

%
% trainError contains the root mean squared error for the training data at each training epoch. The training error for fis is the minimum value in trainError.

fisRMSE = min(trainError)

% Copyright 2012 The MathWorks, Inc.