st_dsub.m

来自「FISMAT accommodates different arithmetic」· M 代码 · 共 43 行

M
43
字号
function st_dsub(temper,infop,accop)

% st_dsub(temper,infop,accop)
%
% sub-function of the simple temperature demo st_demo.m.
%
% FSTB - Fuzzy Systems Toolbox for MATLAB
% Copyright (c) 1993-1996 by Olaf Wolkenhauer
% Control Systems Centre at UMIST
% Manchester M60 1QD, UK
%
% 21-April-1994
 
global T TEMP P POWER

aT=match(T,temper,TEMP);
cool=1; zero=2; heat=3;
RuleBank=[heat zero cool];

% Aggregation:
A=aT;

B=inferenc(A,POWER,RuleBank,infop);
B=accumulu(B,accop);

%clf
subplot(2,1,1), plot_set(T,TEMP); hold on
title('TEMP:          "cold"             "normal"              "hot" ');
plot([temper temper],[0 1],'g');
ylabel(['Input=',num2str(temper)]);
subplot(2,1,2), plot_set(P,POWER); hold on
title('POWER:    "cool"                  "zero"               "heat" ');
output=sum(P*B')/sum(B);
% The fill command closes the curve with the first point if the curve is
% open. Therefore a manipulation necessary:
if B(1)>0, B(1)=0;end;
if B(length(B))>0, B(length(B))=0;end;
plot([output output],[0 1],'g');
ylabel(['Output=',num2str(output)]);
xlabel(['Inference: ',infop,'        Accumulation: ',accop]);
hold off

⌨️ 快捷键说明

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