rule4.m

来自「Fuzzy Control Systems Design and Analysi」· M 代码 · 共 54 行

M
54
字号




function out = rule4(input,l,lc,rc,r)


d=size(input);

for i=1:d(2)
    

    
if input(i) < l
out(i)=0;
end

if input(i) > r
out(i)=0;
end

if input(i) > lc
out(i)=0;
end

if input(i) < rc
out(i)=0;
end




if input(i) > l && input(i) < lc
out(i)=(lc-input(i))./(lc-l);

end


if input(i) > rc && input(i) < r
    
out(i)=(input(i)-rc)./(r-rc);

end


if input(i) == r
out(i)=1;
end    



end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?