Granulator = mamfis('Name','Granulator','NumInputs',2,'NumOutputs',1);
Granulator.Inputs(1).Name = "G_inp1";
Granulator.Inputs(2).Name = "G_inp2";
Granulator.Outputs(1).Name = "G_out";
CTMCM = mamfis('Name','CTMCM','NumInputs',2,'NumOutputs',1);
CTMCM.Inputs(1).Name = "CTMCM_inp1";
CTMCM.Inputs(2).Name = "CTMCM_inp2";
CTMCM.Outputs(1).Name = "CTMCM_out";
OTF = mamfis('Name','OTF','NumInputs',2,'NumOutputs',1);
OTF.Inputs(1).Name = "OTF_inp1";
OTF.Inputs(2).Name = "OTF_inp2";
OTF.Outputs(1).Name = "OTF_out";
con1 = ["Granulator/G_out" "CTMCM/CTMCM_inp1"];
con2 = ["CTMCM/CTMCM_out" "OTF/OTF_inp1"];
tree = fistree([Granulator CTMCM OTF],[con1;con2]);
options = tunefisOptions;
options.Method = 'particleswarm';
options.OptimizationType = 'learning';
options.NumMaxRules = 10;
options.UseParallel = false;
options.MethodOptions.MaxIterations = 2;
fisout1 = tunefis(tree,[],trnX,trnY,options);