matlab genfis,Generate fuzzy inference system structure from data

Obtain the input and output data.

load clusterdemo.dat

inputData = clusterdemo(:,1:2);

outputData = clusterdemo(:,3);

Create a genfisOptions option set for FCM Clustering, specifying a Mamdani FIS type.

opt = genfisOptions('FCMClustering','FISType','mamdani');

Specify the number of clusters.

opt.NumClusters = 3;

Suppress the display of iteration information to the Command Window.

opt.Verbose = 0;

Generate the FIS.

fis = genfis(inputData,outputData,opt);

The generated FIS contains one rule for each cluster.

showrule(fis)

ans = 3x83 char array

'1. If (in1 is in1cluster1) and (in2 is in2cluster1) then (out1 is out1cluster1) (1)'

'2. If (in1 is in1cluster2) and (in2 is in2cluster2) then (out1 is out1cluster2) (1)'

'3. If (in1 is in1cluster3) and (in2 is in2cluster3) then (out1 is out1cluster3) (1)'

Plot the input and output membership functions.

[x,mf] = plotmf(fis,'input',1);

subplot(3,1,1)

plot(x,mf)

xlabel('Membership Functions for Input 1')

[x,mf] = plotmf(fis,'input',2);

subplot(3,1,2)

plot(x,mf)

xlabel('Membership Functions for Input 2')

[x,mf] = plotmf(fis,'output',1);

subplot(3,1,3)

plot(x,mf)

xlabel('Membership Functions for Output')

5df2a38cb5719721a3eb906f877943c0.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值