x = linspace(-6.5, 6.5, 261)';
y = 6*abs(x) - x.^2 + 3.25;
genOpt = genfisOptions('GridPartition');
genOpt.NumMembershipFunctions = 27;
genOpt.InputMembershipFunctionType = 'gaussmf';
genOpt.OutputMembershipFunctionType = 'constant';
iniFIS = genfis(x, y, genOpt);
opt = anfisOptions('InitialFIS', iniFIS);
opt.DisplayANFISInformation = 0;
opt.DisplayErrorValues = 0;
opt.DisplayFinalResults = 0;
outFIS = anfis([x y], opt);
plotmf(outFIS, 'input', 1, 1301),
grid on, ylim([-0.5, 1.5])
title('27 Input Gaussian MFs')
delete(findobj(gca, 'Type', 'text'));
x1 = linspace(-6.5, 6.5, 27*3)';
y1 = 6*abs(x1) - x1.^2 + 3.25;
plot(x1, y1, 'o'), hold on
plot(x, evalfis(outFIS, x), 'linewidth', 1.5), hold off
legend('Training Data', 'ANFIS Output', 'location', 'south')
title('McDonald''s Logo')