%% Add Type-2 Membership Function to Fuzzy Variable
% Create a fuzzy variable with a specified range. By default, this variable has no membership functions.

var = fisvar([0 9]);

% To add a type-2 membership function to a variable with no existing membership functions, specify either a LowerLag or LowerScale value for the membership function. For example specify a lower scale value.

var = addMF(var,"trimf",[0 3 6],'LowerScale',1);

% Once a variable contains a type-2 membership function, you can add additional type-2 membership functions without specifying one of these parameters.

var = addMF(var,"trimf",[3 6 9]);

% View the membership functions.

var.MembershipFunctions

% Copyright 2019 The MathWorks, Inc.