%% Create and Evaluate Parallel FIS Tree
% This example shows construction of a parallel FIS tree. For more information on the types of fuzzy tree structures, see Fuzzy Trees.
% Create fuzzy systems fis1, fis2, and fis3, each with two inputs and one input.

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

% Create the FIS tree such that all of the FIS objects are in parallel; that is, there are no interconnections and all the FIS outputs are FIS tree outputs.

parTree = fistree([fis1 fis2],[]);

% Display the inputs of the FIS tree.

parTree.Inputs

% Display the outputs of the FIS tree.

parTree.Outputs

% Evaluate the FIS tree.

output = evalfis(parTree,[0.1 0.3 0.8 0.4]);

% Generate the final output by summing the FIS tree outputs.

finalOutput = sum(output);

% Copyright 2018 The MathWorks, Inc.