【Fuzzy】隶属度函数和模糊推理

π \pi π型隶属度函数

隶属度函数的形状和符号 π \pi π相似,使用fuzzy logical toolbox函数实现

% 建立pi型隶属度函数
x=0:0.1:10;
y=pimf(x, [1, 4, 5, 10]); % 参数表示图像绘制
plot(x, y);
xlabel('input values');
ylabel('output values');
grid on;

pifunc

Gaussian型隶属度函数

%% gaussian型隶属度函数
x=0:0.1:10;
y=gaussmf(x, [2, 5]); % if-then形式表示对象控制,5表示中心点,2表示图形宽度
plot(x, y);
xlabel('input values');
ylabel('output values');
grid on;

guassian

钟型隶属度函数

%% 钟型隶属度函数
x=0:0.1:10;
y=gbellmf(x, [2, 4, 6]);
plot(x, y);
xlabel('input values');
ylabel('output values');
grid on;

bell

S型隶属度函数

%% S型隶属度函数
x=0:0.1:10;
y=smf(x, [1 8]);
plot(x, y);
xlabel('input values');
ylabel('output values');
grid on;

S shape

梯形隶属度函数

%% 梯形隶属度函数
x=0:0.1:10;
y=trapmf(x, [1 5 7 8]);
plot(x, y);
xlabel('input values');
ylabel('output values');
grid on;

tramp

三角型隶属度函数

%% 三角型隶属度函数
x=0:0.1:10;
y=trimf(x, [2 6 7]);
plot(x, y);
xlabel('input values');
ylabel('output values');
grid on;

triangle

Z型隶属度

%% Z型隶属度函数
x=0:0.1:10;
y=zmf(x, [2 6]);
plot(x, y);
xlabel('input values');
ylabel('output values');
grid on;

Z

应用:模糊控制系统

建立一个分数-奖励的模糊推理系统

%% 模糊推理系统
fisMat=newfis('ss');
fisMat=addvar(fisMat,'input','scores',[0  10]);
fisMat=addvar(fisMat,'output','gains',[0  100]);
fisMat=addmf(fisMat,'input',1,'BAD','gaussmf',[1.2  0]);
fisMat=addmf(fisMat,'input',1,'MED','gaussmf',[1.2  5]);
fisMat=addmf(fisMat,'input',1,'GOOD','gaussmf',[1.2  10]);
fisMat=addmf(fisMat,'output',1,'Low','trapmf',[0 0 10 50]);
fisMat=addmf(fisMat,'output',1,'Mid','trimf',[10 30 80]);
fisMat=addmf(fisMat,'output',1,'High','trapmf',[50 80 100 100]);
rulelist=[1 1 1 1;2 2 1 1; 3 3 1 1];
fisMat=addrule(fisMat,rulelist);
subplot(3,1,1);plotmf(fisMat,'input',1);xlabel('scores');ylabel('input membership');
subplot(3,1,2);plotmf(fisMat,'output',1);xlabel('gains');ylabel('out membership')
subplot(3,1,3);gensurf(fisMat);

fuzzy ss

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Quant0xff

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值