Contenuto principale

setfis

(Removed) Set fuzzy system properties

    setfis has been removed. Set fuzzy inference system properties using dot notation instead. For more information, see Version History.

    Description

    outfis = setfis(infis,fisPropName,fisPropValue) sets the specified property of the fuzzy system infis to the specified value.

    example

    outfis = setfis(infis,varType,varIndex,varPropName,varPropValue) sets the specified property of a variable in a fuzzy system.

    example

    outfis = setfis(infis,varType,varIndex,'mf',mfIndex,mfPropName,mfPropValue) sets the specified property of a membership function for an input or output variable in a fuzzy system.

    example

    Examples

    collapse all

    Load a fuzzy inference system.

    fis = readfis('tipper');

    Set the defuzzification method to the bisector method.

    fis = setfis(fis,'defuzzmethod','bisector');

    View the defuzzification method of the updated FIS.

    getfis(fis,'defuzzmethod')
    ans = 
    'bisector'
    

    Load a fuzzy inference system.

    fis = readfis('tipper');

    Set the name of the first input variable to 'help'.

    fis = setfis(fis,'input',1,'name','help');

    View the name of the variable in the updated system.

    getfis(fis,'input',1,'name')
    ans = 
    'help'
    

    Load a fuzzy inference system.

    fis = readfis('tipper');

    Change the type of the second membership function of the first input variable to a triangular membership function.

    fis = setfis(fis,'input',1,'mf',2,'type','trimf');

    When changing the type of a membership function, you must also set the parameters accordingly. To convert the original Gaussian membership function parameters to triangular membership function parameters, use the mf2mf command.

    gaussParams = getfis(fis,'input',1,'mf',2,'params');
    triParams = mf2mf(gaussParams,'gaussmf','trimf');

    Set the membership function parameters to the converted values.

    fis = setfis(fis,'input',1,'mf',2,'params',triParams);

    View the updated membership function properties.

    getfis(fis,'input',1,'mf',2)
    ans = struct with fields:
          Name: 'good'
          Type: 'trimf'
        params: [1.4680 5 8.5320]
    
    

    Input Arguments

    collapse all

    Fuzzy system, specified as a FIS object.

    Fuzzy system, specified as one of the following values.

    • 'name'

    • 'type'

    • 'andmethod'

    • 'ormethod'

    • 'impmethod'

    • 'aggmethod'

    • 'defuzzmethod'

    Fuzzy system property value, specified as a string or character vector.

    Variable type, specified as either 'input' or 'output'.

    Variable index, specified as a positive integer.

    Variable property name, specified as either 'name' or 'range'.

    Variable property value, specified as a character vector or string (when varPropName is 'name') or a two-element row vector (when varPropName is 'range').

    Membership function index, specified as a positive integer.

    Membership function property name, specified as 'name', 'type', or 'params'.

    Membership function property value, specified as a character vector or string (when mfPropName is 'name' or 'type') or a two-element row vector (when mfPropName is 'params').

    Output Arguments

    collapse all

    Updated fuzzy system, returned as a FIS object.

    Version History

    Introduced before R2006a

    expand all

    See Also