Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

setfis

Set fuzzy system properties

Syntax

fis = setfis(fis,fisPropertyName,fisPropertyValue)
fis = setfis(fis,varType,varIndex,varPropertyName,varPropertyValue)
fis = setfis(fis,varType,varIndex,'mf',mfIndex,mfPropertyName,mfPropertyValue)

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.

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

    • 'name'

    • 'type'

    • 'andmethod'

    • 'ormethod'

    • 'impmethod'

    • 'aggmethod'

    • 'defuzzmethod'

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

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

  • varPropertyValue — 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').

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

  • mfPropertyValue — 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 funuction 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]

See Also

Introduced before R2006a

Was this topic helpful?