%% Evaluate Tree of Fuzzy Inference Systems
% Create a pair of Mamdani fuzzy inference systems.

fis1 = mamfis('Name','fis1','NumInputs',2,'NumOutputs',1);
fis2 = mamfis('Name','fis2','NumInputs',2,'NumOutputs',1);

% Define the connection between the two.

con = ["fis1/output1" "fis2/input1"];

% Create a tree of fuzzy inference systems.

tree = fistree([fis1 fis2],con);

% Create an evalfisOptions option set, specifying the number of samples in the output fuzzy sets.

options = evalfisOptions('NumSamplePoints',50);

% Evaluate the fistree object using a specified input combination and this option set.

y = evalfis(tree,[0.5 0.2 0.7],options)

% Copyright 2018 The MathWorks, Inc.