xorfis.m
来自「模糊神经网络与软件计算的各章代码」· M 代码 · 共 40 行
M
40 行
% If the input labels are 'x' and 'y', some weird error occurs in% surfview().% Create a new FIS.xorfis = newfis('xor', 'sugeno');% Set up input 1 and it's MFs.xorfis = addvar(xorfis, 'input', 'X', [0 1]);xorfis = addmf(xorfis, 'input', 1, 'near 0', 'zmf', [0 1]);xorfis = addmf(xorfis, 'input', 1, 'near 1', 'smf', [0 1]);% Set up input 2 and it's MFs.xorfis = addvar(xorfis, 'input', 'Y', [0 1]);xorfis = addmf(xorfis, 'input', 2, 'near 0', 'zmf', [0 1]);xorfis = addmf(xorfis, 'input', 2, 'near 1', 'smf', [0 1]);% Set up output and it's MFs.xorfis = addvar(xorfis, 'output', 'class', [0 1]);xorfis = addmf(xorfis, 'output', 1, 'zero', 'linear', [0 0 0]);xorfis = addmf(xorfis, 'output', 1, 'one', 'linear', [0 0 1]);xorfis = addmf(xorfis, 'output', 1, 'one', 'linear', [0 0 1]);xorfis = addmf(xorfis, 'output', 1, 'zero', 'linear', [0 0 0]);% Set up rule listrulelist = [1 1 1 1 1; 1 2 2 1 1; 2 1 3 1 1; 2 2 4 1 1];xorfis = addrule(xorfis, rulelist);%figure; surfview(xorfis);% Write the newly created FIS to a filewritefis(xorfis, 'xor');% Display the i/o surface of the FISfigure; gensurf(xorfis);set(gca, 'box', 'on');frot3d on
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?