⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 trapeze.m

📁 a collection of M-files to study concepts in the following areas of Fuzzy-Set-Theory: Fuzzy or Multi
💻 M
字号:
function [f]=trapeze(x,s,t,c)
%TRAPEZE:  Membership function for matrix X will be drawn using a 
%          trapezoidal shape.
%
%                            [Y]=TRAPEZE(X,a,b,c)
%
%          Where a, b and c are slope, flatness and center of trapezoidal.
%          Defaults value for c and b and a are 0, 0 and 1 respectively.
%
%                          See also BELL_1, BELL_2, SIGMOID, and MF_PANEL.


% FISMAT: Fuzzy Inference Systems toolbox for MATLAB
% (c) A. Lotfi, University of Queensland (Email: lotfia@s1.elec.uq.oz.au)
% 13-10-93
% The program has been tested on MATLAB version 4.1, Sun workstation.

if nargin < 4,c=0;end
if nargin < 3,t=0;end
if nargin < 2,s=1;end

if s == 0 , s=eps; end

z=c+t/2+1/s;
y=c-t/2-1/s;

[m,n]=size(x);


for i=1:m
for j=1:n

if x(i,j) >= z | x(i,j) <= y
    f(i,j) = 0 ;
elseif x(i,j) < c+t/2 & x(i,j) > c-t/2
    f(i,j) = 1 ;
elseif x(i,j) > c
    f(i,j) = s*(z-x(i,j));
else
    f(i,j) = s*(x(i,j)-y);
end

end %for j
end %for i

⌨️ 快捷键说明

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