%% Create Incremental FIS Tree
% This example shows construction of an incremental 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);
fis1.Inputs(1).Name = "color";
fis1.Inputs(2).Name = "doors";
fis2 = mamfis('Name','fis2','NumInputs',2,'NumOutputs',1);
fis2.Inputs(2).Name = "power";
fis3 = mamfis('Name','fis3','NumInputs',2,'NumOutputs',1);
fis3.Inputs(2).Name = "autopilot";
fis3.Outputs(1).Name = "predition";

% Create a connection between output 1 of fis1 and input 1 of fis2.

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

% Create a connection between output 1 of fis2 and input 1 of fis3.

con2 = ["fis2/output1" "fis3/input1"];

% Create the FIS tree.

incTree = fistree([fis1 fis2 fis3],[con1;con2]);

% Display the inputs of the FIS tree.

incTree.Inputs

% Display outputs of the FIS tree.

incTree.Outputs

% Copyright 2018 The MathWorks, Inc.