%% Plot Membership Functions for Type-2 FIS
% Create a type-2 fuzzy inference system.

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

% Plot the membership functions for the second input variable.

plotmf(fis,'input',1)

% The type-2 membership functions have a footprint of uncertainty (FOU) between their upper and lower membership functions.
%
% You can also obtain the plotting data without generating a plot.

[xOut,umfOut,lmfOut] = plotmf(fis,'input',1);

% You can then plot individual membership functions or plot the data using your own custom formatting. For example, plot the upper and lower membership functions for only the second membership function of the first input variable.

plot(xOut(:,2),umfOut(:,2),'r',xOut(:,2),lmfOut(:,2),'b')
xlabel('input1')
ylabel('delicious membership')

% Copyright 2019 The MathWorks, Inc.