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

📄 checkfis.m

📁 模糊控制工具箱,很好用的,有相应的说明文件,希望对大家有用!
💻 M
字号:
function res = checkfis(fis);

% Copyright 2005 The MathWorks, Inc.

%CHECKFIS Checks the fuzzy inference system properties for legal values.
%
% res = CHECKFIS(FIS) returns 1 if all properties have legal values else it
% throws an error.
%

for i =1:1:length(fis.rule)
    if isempty(fis.rule(i).weight)
        ermsg = sprintf('weight of rule %d is empty.',i);
        error(ermsg);        
    end
    if isempty(fis.rule(i).antecedent)
        ermsg = sprintf('antecedent of rule %d is empty.',i);
        error(ermsg);        
    end
    if isempty(fis.rule(i).consequent)
        ermsg = sprintf('consequent of rule %d is empty.',i);
        error(ermsg);        
    end
    if isempty(fis.rule(i).connection)
        ermsg = sprintf('connection of rule %d is empty.',i);
        error(ermsg);
    end
end

for i=1:1:length(fis.input)
    if isempty(fis.input(i).name)
        ermsg = sprintf('name of input %d is empty.',i);
        error(ermsg);
    end
    if isempty(fis.input(i).range)
        ermsg = sprintf('range of input %d is empty.',i);
        error(ermsg);       
    end
end

for i=1:1:length(fis.output)
    if isempty(fis.output(i).name)
        ermsg = sprintf('name of output %d is empty.',i);
        error(ermsg);
    end
    if isempty(fis.output(i).range)
        ermsg = sprintf('range of output %d is empty.',i);
        error(ermsg);       
    end
end

res = 1;

⌨️ 快捷键说明

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