gensurf
Generate fuzzy inference system output surface
Description
gensurf(
generates
the output surface for the fuzzy inference system, fis
)fis
,
plotting the first output variable against the first two input variables.
For fuzzy systems with more than two inputs, the remaining input variables
use the midpoints of their respective ranges as reference values.
Examples
Generate FIS Output Surface
Load a fuzzy inference system.
fis = readfis('tipper');
This fuzzy system has two inputs and one output.
Generate the output surface for the system.
gensurf(fis)
Generate FIS Output Surface for Second Output
Load a fuzzy inference system with two inputs and two outputs.
fis = readfis('mam22.fis');
Create a surface generation option set, specifying the second output as the output to plot. By default, this output is plotted against the first two input variables.
opt = gensurfOptions('OutputIndex',2);
Plot the surface, using the specified option set.
gensurf(fis,opt)
Specify Reference Inputs for Surface Plot
Load a fuzzy inference system with four inputs and one output.
fis = readfis('multiInput.fis');
Create a default gensurfOptions
object..
opt = gensurfOptions;
Specify plotting options to:
Plot the output against the second and third input variable.
Use 20 grid points for both inputs.
Fix the first and fourth inputs at
-0.5
and0.1
respectively. Set the reference values for the second and third inputs toNaN
.
opt.InputIndex = [2 3]; opt.NumGridPoints = 20; opt.ReferenceInputs = [-0.5 NaN NaN 0.1];
Plot the output surface.
gensurf(fis,opt)
Return Surface Values and Suppress Plot
Load a fuzzy inference system.
fis = readfis('tipper');
Generate the output surface, returning the surface data.
[X,Y,Z] = gensurf(fis);
The output values, Z
, are the FIS output evaluated at the corresponding X
and Y
grid points.
Input Arguments
fis
— Fuzzy inference system
mamfis
object | sugfis
object | mamfistype2
object | sugfistype2
object
Fuzzy inference system, specified as one of the following:
mamfis
object — Mamdani fuzzy inference systemsugfis
object — Sugeno fuzzy inference systemmamfistype2
object — Type-2 Mamdani fuzzy inference systemsugfistype2
object — Type-2 Sugeno fuzzy inference system
options
— Surface generation options
gensurfOptions
option set
Surface generation options, specified as a gensurfOptions
option
set.
Output Arguments
X
— Grid values for first input variable
array | column vector
Grid values for first input variable, returned as one of the following:
M-by-N array, where N and M are the number of grid points for the first and second inputs, respectively; that is
options.NumGridPoints = [N M]
. Each column ofX
contains one grid point value, repeated for every row.P-element column vector, where P is the number of grid points specified for a single input variable; that is
options.NumGridPoints = P
. Each element of contains one grid point value. This case applies whenfis
has only one input variable.
Y
— Grid values for second input variable
array | []
Grid values for second input variable, returned as one of the following:
M-by-N array, where N and M are the number of grid points for the first and second inputs respectively; that is
options.NumGridPoints = [N M]
. Each row ofY
contains one grid point value, repeated for every column.[]
when you specify only one input variable; that is, if you specifyoptions.InputIndex
as an integer.
Z
— Surface output values
array | vector
Surface output values for the output variable of fis
specified
by options.OutputIndex
, returned as one of the
following:
M-by-N array, where N and M are the number of grid points for the first and second inputs respectively; that is
options.NumGridPoints = [N M]
. Each element ofZ
is the value of the FIS output, evaluated at the correspondingX
andY
input values. For example, for a two-input system:Z(i,j) = evalfis(fis,[X(i,j) Y(i,j)]);
P-element column vector, where P is the number of grid points specified for a single input variable; that is
options.NumGridPoints = P
. Each element ofZ
is the value of the FIS output evaluated at the correspondingX
input value.
When computing the value of Z
, gensurf
sets
the values of any inputs not specified by options.InputIndex
to
their corresponding reference values, as specified in options.ReferenceInputs
.
Version History
Introduced before R2006aR2019b: Support for representing fuzzy inference systems as structures will be removed
Warns starting in R2019b
Support for representing fuzzy inference systems as structures will be removed in a future
release. Use mamfis
and
sugfis
objects
instead. There are differences between these representations that require updates to your
code. These differences include:
Object property names that differ from the corresponding structure fields.
Objects store text data as strings rather than as character vectors.
Also, all Fuzzy Logic Toolbox™ functions that accepted or returned fuzzy inference systems as structures now
accept and return either mamfis
or sugfis
objects.
To convert existing fuzzy inference system structures to objects, use the convertfis
function.
See Also
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)