Function Reference: addrule

Function File: fis = addrule (fis, rule_matrix)

Add a list of rules to an existing FIS structure and return the updated FIS.

Each row of the rule_matrix represents one rule and has the form:

     [in1_mf ... inM_mf out1_mf ... outN_mf weight connect]
 

where:

Element in Rule VectorExpected Type or Value
in<i>_mfmembership function index for input i
out<j>_mfmembership function index for output j
weightrelative weight of the rule (0 <= weight <= 1)
connectantecedent connective (1 == and; 2 == or)
    
Hedge StringEffect of Applying Hedge
"not"prepend a minus sign to the membership function index
"somewhat"append ".05" to the membership function index
"very"append ".20" to the membership function index
"extremely"append ".30" to the membership function index
"very very"append ".40" to the membership function index
custom hedgeappend .xy, where x.y is the degree to which the membership value should be raised, to the membership function index

To omit an input or output, use 0 for the membership function index. The consequent connective is always "and".

For example, to express:

     "If (input_1 is mf_2) or (input_3 is not mf_1) or (input_4 is very mf_1),
      then (output_1 is mf_2) and (output_2 is mf_1^0.3)."
 

with weight 1, the corresponding row of rule_matrix would be:

     [2   0   -1   4.2   2   1.03   1   2]
 

For a complete example that uses addrule, see heart_disease_demo_1.m.

See also: heart_disease_demo_1, showrule