%% Tune Specific Parameter Setting of Fuzzy Inference System
% Create the initial fuzzy inference system using genfis.

x = (0:0.1:10)';
y = sin(2*x)./exp(x/5);
options = genfisOptions('GridPartition');
options.NumMembershipFunctions = 5;
fisin = genfis(x,y,options);            

% Obtain the tunable settings of inputs, outputs, and rules of the fuzzy inference system.

[in,out,rule] = getTunableSettings(fisin);

% Tune the rule parameter only. In this example, the pattern search method is used.

fisout = tunefis(fisin,rule,x,y,tunefisOptions("Method","patternsearch"));

% Copyright 2018 The MathWorks, Inc.