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 system (since R2019b)sugfistype2
object — Type-2 Sugeno fuzzy inference system (since R2019b)
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
.
Alternative Functionality
App
You can interactively view the control surface for a FIS using the Fuzzy Logic Designer app.
Version History
Introduced before R2006aR2019b: 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.
R2017a: Specify options using gensurfOptions
To specify options for generating fuzzy inference system output surfaces , you now
create a gensurfOptions
option set. You can then
modify the options using dot notation. Any options you do not modify remain at their
default values.
Previously, to generate an output surface for a fuzzy inference system using
gensurf
, you specified the generation options using
optional input arguments.
gensurf(fis,inputs,output,grids,refInput,points);
Starting in R2017a, if your code uses gensurf
, modify the
code to use a gensurfOptions
option set.
opt = gensurfOptions; opt.InputIndex = [1 3]; fis = gensurf(fis,opt);
The following table shows the mapping of the old gensurf
input arguments to the new gensurfOptions
option set.
Old gensurf Input
Argument | New gensurfOptions
Option |
---|---|
inputs | InputIndex |
output | OutputIndex |
grids | NumGridPoints |
refinput | ReferenceInputs |
points | NumSamplePoints |
See Also
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
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)