Neuro-Fuzzy (ANFIS) in MATLAB


ANFIS (adaptive network-based fuzzy inference system) is an adaptable and educational network that is quite similar in function to the fuzzy inference system.

To create an optimal fuzzy system based on input and output data sets, use ANFIS in the Fuzzy toolbox. As we know, fuzzy-neural methods, using the advantages of both fuzzy and neural methods, have the ability to deal with uncertainties and noise in the controlled system. Therefore, it is possible to convert a fuzzy structure to each other by a neural network, and vice versa. In fact, it is possible to take advantage of both methods. So far, many algorithms have been proposed for teaching fuzzy rules and optimal regulation of membership functions by neural networks.


In the Fuzzy toolbox in MATLAB software, the ANFIS method is used for this purpose. This structure is proposed by Jang [1]. ANFIS is a fuzzy inference system with adaptive capability, which is actually a feedforward neural network with training capability. In the Fuzzy toolbox, there are two ways to train the neural network related to this structure.

  • Error back-propagation method
  • The hybrid method, which is actually a combination of the error propagation method and the least squares.

This structure can only be implemented in the Sugeno fuzzy system. The Sugeno fuzzy system must be zero or one order. The fuzzy system obtained by ANFIS has only one output and its non-fuzzy process is a weighted average. All output membership functions are the same and are of linear or fixed type.


Generating a fuzzy structure with ANFIS :

In the Fuzzy toolbox, there are two solutions for generating a fuzzy structure with ANFIS. The first method is network separation and the second method is reduction clustering. The genefis1 command is used to generate the fuzzy structure by the network separation method and the genfis2 method is used if the reduction clustering method is used. The fuzzy structure can be created with the number of membership functions and the type of membership function desired.


For simplicity, we assume that our fuzzy system has two inputs x and y and its output is z. Now if the rules are as follows:

anfis training video neuro fuzzy MATLAB code2

And if we use the average of the centers for the non-fuzzy generator, the output will be as follows:

anfis training video neuro fuzzy MATLAB code3

The equivalent structure of ANFIS will be as follows:

anfis training video neuro fuzzy MATLAB code


J. -. R. Jang, “ANFIS: adaptive-network-based fuzzy inference system,” in IEEE Transactions on Systems, Man, and Cybernetics, vol. 23, no. 3, pp. 665-685, May-June 1993, doi: 10.1109/21.256541.


There are no reviews yet.

Be the first to review “Neuro-Fuzzy (ANFIS) in MATLAB”

Your email address will not be published. Required fields are marked *