addmf
Add a membership function to an existing FIS structure and return the updated FIS.
The types of the arguments are expected to be:
If mf_type is one of the built-in membership functions, then the number and values of the parameters must satisfy the membership function requirements for the specified mf_type.
Note that addmf will allow the user to add membership functions or membership function names for a given input or output variable that duplicate mfs or mf names already entered.
Also, constant and linear membership functions are not restricted to FIS structure outputs or to Sugeno-type FIS structures, and the result of using them for FIS inputs or Mamdani-type FIS outputs has not yet been tested.
To run the demonstration code, type "demo addmf" (without the quotation marks) at the Octave prompt. This demo creates two FIS input variables and associated membership functions and then produces two figures showing the term sets for the two FIS inputs.
## Create new FIS. a = newfis ('Heart-Disease-Risk', 'sugeno', ... 'min', 'max', 'min', 'max', 'wtaver'); ## Add two inputs and their membership functions. a = addvar (a, 'input', 'LDL-Level', [0 300]); a = addmf (a, 'input', 1, 'Low', 'trapmf', [-1 0 90 110]); a = addmf (a, 'input', 1, 'Low-Borderline', 'trapmf', ... [90 110 120 140]); a = addmf (a, 'input', 1, 'Borderline', 'trapmf', ... [120 140 150 170]); a = addmf (a, 'input', 1, 'High-Borderline', 'trapmf', ... [150 170 180 200]); a = addmf (a, 'input', 1, 'High', 'trapmf', [180 200 300 301]); a = addvar (a, 'input', 'HDL-Level', [0 100]); a = addmf (a, 'input', 2, 'Low-HDL', 'trapmf', [-1 0 35 45]); a = addmf (a, 'input', 2, 'Moderate-HDL', 'trapmf', [35 45 55 65]); a = addmf (a, 'input', 2, 'High-HDL', 'trapmf', [55 65 100 101]); ## Plot the input membership functions. plotmf (a, 'input', 1); plotmf (a, 'input', 2); hold is now off for current axes hold is now off for current axes |
addrule
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:
To express:
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
addvar
Add an input or output variable to an existing FIS structure and return the updated FIS.
The types of the arguments are expected to be:
The vector components x1 and x2, which must also satisfy x1 <= x2, specify the lower and upper bounds of the variable’s domain.
To run the demonstration code, type "demo addvar" (without the quotation marks) at the Octave prompt.
a = newfis ('Heart-Disease-Risk', 'sugeno', ... 'min', 'max', 'min', 'max', 'wtaver'); a = addvar (a, 'input', 'LDL-Level', [0 300]); getfis (a, 'input', 1); Name = LDL-Level NumMFs = 0 MFLabels = Range = [0 300] |
algebraic_product
Return the algebraic product of the input. The algebraic product of two real scalars x and y is: x * y
For one vector argument, apply the algebraic product to all of elements of the vector. (The algebraic product is associative.) For one two-dimensional matrix argument, return a vector of the algebraic product of each column.
For two vectors or matrices of identical dimensions, or for one scalar and one vector or matrix argument, return the pair-wise product.
See also: algebraic_sum, bounded_difference, bounded_sum, drastic_product, drastic_sum, einstein_product, einstein_sum, hamacher_product, hamacher_sum
algebraic_sum
Return the algebraic sum of the input. The algebraic sum of two real scalars x and y is: x + y - x * y
For one vector argument, apply the algebraic sum to all of elements of the vector. (The algebraic sum is associative.) For one two-dimensional matrix argument, return a vector of the algebraic sum of each column.
For two vectors or matrices of identical dimensions, or for one scalar and one vector or matrix argument, return the pair-wise algebraic sum.
See also: algebraic_product, bounded_difference, bounded_sum, drastic_product, drastic_sum, einstein_product, einstein_sum, hamacher_product, hamacher_sum