setfis
(To be removed) Set fuzzy system properties
setfis
will be removed in a future release. Set fuzzy inference
system properties using dot notation instead. For more information, see Compatibility Considerations.
Syntax
Description
sets the specified property of the fuzzy system outfis
= setfis(infis
,fisPropName
,fisPropValue
)infis
to the specified
value.
sets the specified property of a variable in a fuzzy system.outfis
= setfis(infis
,varType
,varIndex
,varPropName
,varPropValue
)
sets the specified property of a membership function for an input or output variable in a
fuzzy system.outfis
= setfis(infis
,varType
,varIndex
,'mf',mfIndex
,mfPropName
,mfPropValue
)
Examples
Set Fuzzy Inference System Properties
Load a fuzzy inference system.
fis = readfis('tipper');
Set the defuzzification method to the bisector method.
fis = setfis(fis,'defuzzmethod','bisector');
View the defuzzification method of the updated FIS.
getfis(fis,'defuzzmethod')
ans = 'bisector'
Set Variable Properties in FIS
Load a fuzzy inference system.
fis = readfis('tipper');
Set the name of the first input variable to 'help'
.
fis = setfis(fis,'input',1,'name','help');
View the name of the variable in the updated system.
getfis(fis,'input',1,'name')
ans = 'help'
Set Membership Function Properties in FIS
Load a fuzzy inference system.
fis = readfis('tipper');
Change the type of the second membership function of the first input variable to a triangular membership function.
fis = setfis(fis,'input',1,'mf',2,'type','trimf');
When changing the type of a membership function, you must also set the parameters
accordingly. To convert the original Gaussian membership function parameters to
triangular membership function parameters, use the mf2mf
command.
gaussParams = getfis(fis,'input',1,'mf',2,'params'); triParams = mf2mf(gaussParams,'gaussmf','trimf');
Set the membership function parameters to the converted values.
fis = setfis(fis,'input',1,'mf',2,'params',triParams);
View the updated membership function properties.
getfis(fis,'input',1,'mf',2)
ans = struct with fields:
Name: 'good'
Type: 'trimf'
params: [1.4680 5 8.5320]
Input Arguments
infis
— Fuzzy system
mamfis
object | sugfis
object
Fuzzy system, specified as a FIS object.
fisPropName
— Fuzzy system property name
string | character vector
Fuzzy system, specified as one of the following values.
'name'
'type'
'andmethod'
'ormethod'
'impmethod'
'aggmethod'
'defuzzmethod'
fisPropValue
— Fuzzy system property value
string | character vector
Fuzzy system property value, specified as a string or character vector.
varType
— Variable type
'input'
| 'output'
Variable type, specified as either 'input'
or
'output'
.
varIndex
— Variable index
positive integer
Variable index, specified as a positive integer.
varPropName
— Variable property name
'name'
| 'range'
Variable property name, specified as either 'name'
or
'range'
.
varPropValue
— Variable property value
string | character vector | two-element row vector
Variable property value, specified as a character vector or string (when
varPropName
is 'name'
) or a two-element row
vector (when varPropName
is 'range'
).
mfIndex
— Membership function index
positive integer
Membership function index, specified as a positive integer.
mfPropName
— Membership function property name
'name'
| 'type'
| 'params'
Membership function property name, specified as 'name'
,
'type'
, or 'params'
.
mfPropValue
— Membership function property value
string | character vector | row vector
Membership function property value, specified as a character vector or string (when
mfPropName
is 'name'
or
'type'
) or a two-element row vector (when
mfPropName
is 'params'
).
Output Arguments
outfis
— Updated fuzzy system
mamfis
object | sugfis
object
Updated fuzzy system, returned as a FIS object.
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.
R2018b: To be removed
setfis
will be removed in a future release. Set fuzzy inference
system properties using dot notation instead. There are differences between these approaches
that require updates to your code.
This table shows some typical usages of setfis
for setting fuzzy
inference system properties and how to update your code to use dot notation
instead.
If your code has this form: | Use this code instead: |
---|---|
fis = setfis(fis,'andmethod','prod') |
fis.AndMethod = 'prod' |
fis = setfis(fis,'input',1,... 'name','service') |
fis.Inputs(1).Name = "service" |
fis = setfis(fis,'input',2,... 'mf',1,... params,[5 10 15]) |
fis.Inputs(2).MembershipFunctions(1).Parameters = ... [5 10 15] |
Previously, fuzzy inference systems were represented as structures. Now, fuzzy
inference systems are represented as objects. Fuzzy inference system object properties
have different names than the corresponding structure fields. For more information on
fuzzy inference system objects, see mamfis
and
sugfis
.
See Also
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 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)