📄 l_mean.m
字号:
function meanv=L_mean(Lset)% meanv=L_mean(Lset)%% The mean value of a fuzzy number in level-set representation.%% The fuzzy quantity Lset is defined in terms of alpha-cuts (level sets).% The first column defines the levels. The second and third column define % the alpha cut of the associated level.% If invoked without lefthand arguments a plot is generated. If invoked without% input parameters, an example is created.%% The mean value is defined as an interval whose bounds are upper and lower% expectations. meanv=[a b]=[E^*(L_set) E_*(L_set)] with% E^*(L_set) = \sum_{i=1}^nol (\alpha_i - \alpha_{i+1}) \sup Lset_{\alpha_i}% E_*(L_set) = \sum_{i=1}^nol (\alpha_i - \alpha_{i+1}) \inf Lset_{\alpha_i}% where \alpha_1 =1 > \alpha_2 > \ldots > \alpha_nol and \alpha_{nol+1}=0.%% Reference:% D.Dubois and H.Prade% "The Mean Value of a Fuzzy Number"% Fuzzy Sets and Systems 24 (1987), pp.279-300.% FSTB - Fuzzy Systems Toolbox for MATLAB% Copyright (c) 1993-1996 by Olaf Wolkenhauer% Control Systems Centre at UMIST% Manchester M60 1QD, UK% 14 June 1996% Last change: 20 June 1996 if nargin==0, Lset=[1 1 1 ; 0.75 0.75 1.25 ; 0.5 0.5 1.5 ; 0.25 0.25 1.75]; end;nol = size(Lset,1);% dummy=[Lset(1,1); diff(Lset(:,1))];dummy = flipud(diff(flipud([Lset(:,1);0])));a=dummy'*Lset(:,2); % lower bound/expectation.b=dummy'*Lset(:,3); % upper bound/expectation.meanv = [a b];if nargin==0 | nargout==0, x_max=Lset(nol,3); x_min=Lset(nol,2); from=x_min-(x_max-x_min)/100*10; to=x_max+(x_max-x_min)/100*10; plot_Lset(Lset,'y'); %title('Mean value of a fuzzy number:'); set(gca,'YTick',sort([Lset(:,1);0])); set(gca,'XTick',chop(sort([Lset(:,2);Lset(:,3)]),2)); axis([from to 0 1.2]);grid hold on % Draw line at left boundary: ord=linspace(0,1,10); abcis=a.*ones(1,10); line(abcis,ord,'Color','r'); plot(a,1,'r*'); % Draw line for right boundary: ord=linspace(0,1,10); abcis=b.*ones(1,10); line(abcis,ord,'Color','r'); plot(b,1,'r*'); hold off xlabel(['Mean value = [',num2str(chop(a,3)),', ',num2str(chop(b,3)),']']);end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -