%% Specify Tunability of Parameter Settings
% Create a fuzzy inference system, and define the tunable parameter settings of inputs, outputs, and rules.
% Create a FIS, and obtain its tunable settings.

fis = mamfis("NumInputs",2,"NumOutputs",2);
[in,out,rule] = getTunableSettings(fis);

% You can specify all the input variables, output variables, or rules as tunable or nontunable. For example, set all the output variable settings as nontunable.

out = setTunable(out,0);

% You can set the tunability of individual variables or rules. For example, set the first input variable as nontunable.

in(1) = setTunable(in(1),0);

% You can set individual membership functions as nontunable. For example, set the first membership function of input 2 as nontunable.

in(2).MembershipFunctions(1) = setTunable(in(2).MembershipFunctions(1),0);

% You can also specify the tunability of a subset of variables or rules. For example, set the first two rules as nontunable.

rule(1:2) = setTunable(rule(1:2),0);

% Copyright 2019 The MathWorks, Inc.