setfis

(To be removed) Set fuzzy system properties

setfis will be removed in a future release. Set fuzzy inference system properties using dot notation instead. For more information, see Compatibility Considerations.

Syntax

fis = setfis(fis,fisPropName,fisPropVal)
fis = setfis(fis,varType,varIndex,varPropName,varPropVal)
fis = setfis(fis,varType,varIndex,'mf',mfIndex,mfPropName,mfPropVal)

Description

The command setfis can be called with three, five, or seven input arguments, depending on whether you want to set a property of the entire FIS structure, for a particular variable belonging to that FIS structure, or for a particular membership function belonging to one of those variables. The arguments are:

  • fis — FIS structure in the MATLAB® workspace.

  • varType — Variable type, specified as either 'input' or 'output'.

  • varIndex — Variable index, specified as a positive integer.

  • mfIndex — Membership function index, specified as a positive integer.

  • fisPropName — FIS property you want to set, specified as one of the following:

    • 'name'

    • 'type'

    • 'andmethod'

    • 'ormethod'

    • 'impmethod'

    • 'aggmethod'

    • 'defuzzmethod'

  • fisPropVal — New value of the FIS property you want to set, specified as a character vector or string.

  • varPropName — Variable property you want to set, specified as either 'name' or 'range'.

  • varPropVal — New value of the variable property you want to set, specified as a character vector or string (for 'name'), or a two-element row vector (for 'range').

  • mfPropName — Membership function property you want to set, specified as either 'name', 'type', or 'params'.

  • mfPropVal — New value of the membership function property you want to set, specified as a character vector or string (for 'name' or 'type'), or a numerical row vector (for 'params').

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 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]

Compatibility Considerations

expand all

Not recommended starting in R2018b

See Also

Introduced before R2006a