# genfis1

(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 Version History.

## Syntax

``fis = genfis1(data)``
``fis = genfis1(data,numMFs)``
``fis = genfis1(data,numMFs,inmftype)``
``fis = genfis1(data,numMFs,inmftype,outmftype)``

## Description

````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.```

example

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

## Examples

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); subplot(2,1,1) plot(x,mf) xlabel('input 1 (pimf)') [x,mf] = plotmf(fis,'input',2); subplot(2,1,2) plot(x,mf) 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.

`'gbellmf'`Generalized bell-shaped membership function`gbellmf`
`'gaussmf'`Gaussian membership function`gaussmf`
`'gauss2mf'`Gaussian combination membership function`gauss2mf`
`'trimf'`Triangular membership function`trimf`
`'trapmf'`Trapezoidal membership function`trapmf`
`'sigmf'`Sigmoidal membership function`sigmf`
`'dsigmf'`Difference between two sigmoidal membership functions`dsigmf`
`'psigmf'`Product of two sigmoidal membership functions`psigmf`
`'zmf'`Z-shaped membership function`zmf`
`'pimf'`Pi-shaped membership function`pimf`
`'smf'`S-shaped membership function`smf`

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`
OR`max`
Implication `prod`
Aggregation`max`
Defuzzification`wtaver`

## 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.