%% Evaluate Type-2 Fuzzy Inference System
%
% Create a type-2 Mamdani fuzzy inference system.

fis = mamfistype2('NumInputs',2,'NumOutputs',1);

%
% Evaluate the FIS when the first input is 0.4 and the second input is 0.72.

output = evalfis(fis,[0.4 0.72])

% The output of a type-2 FIS is a crisp value.
%
% When you obtain intermediate fuzzy inference results for a type-2 FIS, you obtain intermediate results generated using both upper and lower MF values. For example, obtain the intermediate fuzzified input values.

[output,fuzzifiedInput] = evalfis(fis,[0.5 0.75]);

% View the fuzzified input values.

fuzzifiedInput

% The first two columns contain the fuzzified values of the first and second inputs based on the upper MF for each input. The second two columns contain the fuzzified values for based on the lower MF for each input.
% Copyright 2019 The MathWorks, Inc.