MATLAB: Does the ADDMF function implement a different set of rules in the Fuzzy Logic Toolbox 2.1.1 (R12.1) than in version 2.1 (R12)

2.12.1.1addmfcommanddifferentfuzzyFuzzy Logic Toolboxlinelogicr12r12.1rulessurfacetoolboxwrong

Why does the ADDMF function implement a different set of rules in the Fuzzy Logic Toolbox 2.1.1 (R12.1) than in version 2.1 (R12)?
Please try the following code using the Fuzzy Logic Toolbox 2.1.1 (R12.1) and then again in version 2.1 (R12):
sfmodel=newfis('SFinish')
sfmodel=addvar(sfmodel, 'input', 'feed-rate', [-1 1])
sfmodel=addvar(sfmodel, 'input', 'depth-of-cut', [-1 1])
sfmodel=addvar(sfmodel, 'output', 'surface-finish', [4.5 18.5])
sfmodel=addmf(sfmodel, 'input', 1, 'low', 'trimf', [-2, -1, 1])
sfmodel=addmf(sfmodel, 'input', 1, 'high', 'trimf', [-1, 1, 2])
sfmodel=addmf(sfmodel, 'input', 2, 'low', 'trimf', [-2, -1, 1])
sfmodel=addmf(sfmodel, 'input', 2, 'high', 'trimf', [-1, 1, 2])
sfmodel=addmf(sfmodel, 'output', 1, 'low', 'trapmf', [4.5, 4.5, 8, 15])
sfmodel=addmf(sfmodel, 'output', 1, 'high', 'trapmf', [8, 15, 18.5, 18.5])
ruleList=[1 0 1 1 1
2 2 2 1 1]
sfmodel=addrule(sfmodel, ruleList)
fuzzy(sfmodel)
Then, in each of the version's Fuzzy GUI's that open, go to View->Rules and View->Surface
The implementation of the rules is VERY different.
In 2.1.1 (R12.1), go to Edit ->Rules, and in 2.1(R12) go to View ->Edit Rules.
Here you can see that the rules have been defined differently. Why?

Best Answer

This problem has been fixed in the Fuzzy Logic Toolbox 2.1.2 (R13).
If you are using a previous version, please see the workaround below:
As a suggested work-around, execute your code within MATLAB 6.1 and within the Fuzzy GUI that opens, go to Edit -> Rules. This will provide you with a GUI window in which you can use the CHANGE RULE button, after altering rules listed in the activation window to the actual implementation. This will correct the rules and surface appearance.