Main Content


(To be removed) Generate fuzzy inference system from data using grid partition

    genfis1 will be removed in a future release. Use genfis instead. For more information, see Compatibility Considerations.


    fis = genfis1(data) returns a single-output Sugeno fuzzy inference system (FIS) using a grid partition of the given training data.

    fis = genfis1(data,numMFs) specifies the number of membership functions to use for each input variable.


    fis = genfis1(data,numMFs,inmftype) specifies the type of membership function to use for input variables.

    fis = genfis1(data,numMFs,inmftype,outmftype) specifies the type of membership function to use for output variables.


    collapse all

    Generate a FIS using grid partitioning.

    data = [rand(10,1) 10*rand(10,1)-5 rand(10,1)];
    numMFs = [3 7];
    mfType = char('pimf','trimf');
    fis = genfis1(data,numMFs,mfType);

    To see the contents of fis, use showfis(fis).

    Plot the FIS input membership functions.

    [x,mf] = plotmf(fis,'input',1);
    xlabel('input 1 (pimf)')
    [x,mf] = plotmf(fis,'input',2);
    xlabel('input 2 (trimf)')

    Input Arguments

    collapse all

    Training data, specified as an array with M + 1 columns. The first M columns represent input variable values and the last column represents the output variable value. The number of rows is the number of training data points.

    Number of membership functions for input variables, specified as a vector of positive integers. Each element of numMFs corresponds to a given input variable. To use the same number of membership functions for all input variables, specify numMFs as a positive integer.

    Input variable membership function type, specified as a string or character vector to use the same membership function for all input variables, or as a character array to use different membership functions for each input variable.

    When you specify a character array, each row specifies the membership function type for one input variable.

    The following table lists possible membership functions.

    Membership function typeDescriptionFor more information
    'gbellmf'Generalized bell-shaped membership functiongbellmf
    'gaussmf'Gaussian membership functiongaussmf
    'gauss2mf'Gaussian combination membership functiongauss2mf
    'trimf'Triangular membership functiontrimf
    'trapmf'Trapezoidal membership functiontrapmf
    'sigmf'Sigmoidal membership functionsigmf
    'dsigmf'Difference between two sigmoidal membership functionsdsigmf
    'psigmf'Product of two sigmoidal membership functionspsigmf
    'zmf'Z-shaped membership functionzmf
    'pimf'Pi-shaped membership functionpimf
    'smf'S-shaped membership functionsmf

    Output variable membership function type, specified as either 'linear' or 'constant'. The number of membership functions associated with the output is the same as the number of rules generated by genfis1.

    Output Arguments

    collapse all

    Fuzzy inference system, returned as a sugfis object.

    The following table shows the default inference methods for this fuzzy system.

    Inference MethodDefault
    AND prod
    Implication prod

    Version History

    Introduced before R2006a

    expand all

    R2019b: Support for fuzzy inference system structures will be removed

    Support for representing fuzzy inference systems as structures will be removed in a future release. Use mamfis and sugfis objects with this function instead. To convert existing fuzzy inference system structures to objects, use the convertfis function.

    This change was announced in R2018b. Using fuzzy inference system structures with this function issues a warning starting in R2019b.

    See Also

    | | |