# gensurf

Generate Fuzzy Inference System output surface

## Syntax

`gensurf(fis)gensurf(fis,inputs,output)gensurf(fis,inputs,output,grids)gensurf(fis,inputs,output,grids,refinput)gensurf(fis,inputs,output,grids,refinput,numofpoints)[x,y,z]=gensurf(...)`

## Description

`gensurf(fis)` generates a plot of the output surface of a given fuzzy inference system (`fis`) using the first two inputs and the first output.

`gensurf(fis,inputs,output)` generates a plot using the inputs (one or two) and output (only one is allowed) given, respectively, by the vector, `inputs`, and the scalar, `output`.

`gensurf(fis,inputs,output,grids)` allows you to specify the number of grids in the X (first, horizontal) and Y (second, vertical) directions. If `grids` is a two element vector, you can set the grids in the X and Y directions independently.

`gensurf(fis,inputs,output,grids,refinput)` allows you to specify a reference input, and can be used if there are more than two outputs. The length of the vector `refinput` is the same as the number of inputs:

• Enter `NaN`s for the entries of `refinput` corresponding to the inputs whose surface is being displayed.

• Enter real double scalars to fix the values of other inputs.

`gensurf(fis,inputs,output,grids,refinput,numofpoints)` allows you to specify the number of sample points on which to evaluate the membership functions in the input or output range. If `numofpoints` is not specified, a default value of 101 is used.

`[x,y,z]=gensurf(...)` returns the variables that define the output surface and suppresses automatic plotting.

## Examples

collapse all

### Generate FIS Output Surface

```a = readfis('tipper'); gensurf(a) ```

### Specify Reference Input for Surface Plot

```a = gensurf(Temp,[1 2],1,[20 20],[nan nan 0.2]); ```

This equation generates the surface of a three-input FIS named `Temp` from its first two inputs to its first output, while fixing a reference value for the third input at .2.