Fuzzy Inference System with Octave

Posted on

A Step-by-Step Guide with Examples

How to create Fuzzy Inference System with Octave? Fuzzy Inference System (FIS) is a computerized system that applies fuzzy logic to interpret and draw conclusions from data. It uses a set of if-then rules to make decisions based on inputs. The inputs are assigned values in fuzzy sets, which represent different degrees of membership in a particular category.

To create a FIS in Octave, the number of inputs, outputs, and fuzzy sets must be specified. For example, consider a FIS with two inputs and one output, where each input has two fuzzy sets and the output has three fuzzy sets. The following code creates such a FIS:

% Define number of inputs, outputs, and fuzzy sets
numInputs = 2;
numOutputs = 1;
numFuzzySets = 2;

% Create the input membership functions
input1MF = [0 0 1 1; 0 1 0 1];
input2MF = [0 0 1 1; 0 1 0 1];

% Create the output membership functions
outputMF = [0 0 1 1 1; 0 0 0 1 1; 0 1 1 1 1];

% Create the fuzzy rules
rules = [1 1 1 1; 1 2 2 2; 2 1 3 3];

% Create the FIS structure
fis = newfis('fisName', 'mamdani', numInputs, numOutputs, numFuzzySets);

% Add the membership functions to the input variables
fis = addvar(fis, 'input', 'input1', [0 1], input1MF);
fis = addvar(fis, 'input', 'input2', [0 1], input2MF);

% Add the membership functions to the output variable
fis = addvar(fis, 'output', 'output', [0 1], outputMF);

% Add the rules to the FIS
fis = addrule(fis, rules);

Once the FIS is created, it can be used to perform inference by inputting values and evaluating the output. The following code performs inference using the inputs [3, 4]:

% Perform inference on the FIS
output = evalfis([3 4], fis);

% Display the inference result
output

The inference result is a numerical value representing the FIS’s confidence level in the conclusion made based on the inputs.

FIS can be used to solve various types of problems, such as control systems, machine diagnosis, and business system modeling. The advantage of FIS is its ability to handle problems with uncertain or subjective data, as well as its ease of understanding and implementation.

However, FIS also has some limitations, such as difficulty in determining the appropriate fuzzy rules and less accuracy if the input data is highly complex. Therefore, it should be applied wisely and carefully when creating a FIS. I hope Fuzzy Inference System with Octave article is useful.

Read more:

Leave a Reply