📄 modlrset.m
字号:
function [f,x] = modlrset(L,R,par,resx)% [f,x] = modlrset(L,R,par,resx)%% Creating the membershipfunction of a LR-fuzzy set.% par = [xmin xmax m1 m2 alpha beta ymin ymax] . % LR-fuzzy-set: the functions L and R must have the following % characteristic:% F(0)=0, F(x)<1 fuer alle x>0, F(x)>0 fuer alle x<1, F(x)=F-x).% L((m1-x)/alpha) for x<m1% F(x)= 1 for m1<=x<=m2% R((x-m2)/beta) for x>m2% Examples are F(x)=e^-x, F(x)=1/(1+x^2), F(x)=max(0,1-x^p)% Trapezoid function : modlrset('tr','',[0,50,30,35,...],127)% Triangular function: modlrset('tr','',[0,50,30,30,...],200) ( m1=m2 ! )%% The membershipfunction f is discrete with the resolution resx.% x contains the abscissa values.% ______% / \ beta is the distance between m2 and b.% __a/ m1 m2 \b___ alpha ------------ " -------- m1 and a.%%% FSTB - Fuzzy Systems Toolbox for MATLAB% Copyright (c) 1993-1996 by Olaf Wolkenhauer% Control Systems Centre at UMIST% Manchester M60 1QD, UK%% 25-Feb-1994xmin=par(1);xmax=par(2);m1=par(3);m2=par(4);alpha=par(5);beta=par(6);ymin=par(7);ymax=par(8);if all(L(1:2)=='tr') L='max(0,(1-x))'; R=L;end;f = zeros(1,resx); dy = ymax-ymin; if (xmin==xmax) o = f; o(:) = xmin;else o = linspace(xmin,xmax,resx); endfor i=1:resx; if (o(i) >= m1) & (o(i) <= m2); f(i)=ymax; end;% if (o(i) < m1); x=(m1-o(i))/(alpha+1e-6); f(i)=ymin+dy*eval(L); end;% if (o(i) > m2); x=(o(i)-m2)/(beta+1e-6); f(i)=ymin+dy*eval(R); end; if (o(i) < m1); x=(m1-o(i))/(alpha+1e-6); f(i)=ymin+dy*max(0,1-x); end; if (o(i) > m2); x=(o(i)-m2)/(beta+1e-6); f(i)=ymin+dy*max(0,1-x); end;end;x=o;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -