• 大小: 5KB
    文件类型: .m
    金币: 1
    下载: 0 次
    发布日期: 2021-05-23
  • 语言: Matlab
  • 标签: 基于  MATLAB  模糊  

资源简介

基于MATLAB的模糊控制表计算程序.m

资源截图

代码片段和文件信息

clc;
clear;tic
E = [10.80.70.40.100000000;
    0.20.710.70.300000000;
    00.10.30.710.70.2000000;
    00000.10.61000000;
    00000010.60.10000;
    0000000.20.710.70.30.10;
    000000000.20.710.70.3;
    000000000.10.40.70.81]%%8*13
EC =[10.70.30000000000;
    0.30.710.70.300000000;
    000.30.710.70.3000000;
    00000.30.710.70.30000;
    0000000.30.710.70.300;
    000000000.30.710.70.3;
    00000000000.30.71]%%7*13
U=[10.70.30000000000;
    0.30.710.70.300000000;
    000.30.710.70.3000000;
    00000.30.710.70.30000;
    0000000.30.710.70.300;
    000000000.30.710.70.3;
    00000000000.30.71]%%7*13
rulelist=  [1111244;
            1111244;
            2222455;
            2234566;
            2234566;
            3346666;
            4467777;
            4467777]%%8*7

for iii=1:13             %偏差E的模糊值控制        
    for jjj=1:13         %偏差率EC的模糊值控制        
        for ii=1:8       %偏差E的模糊规则控制    
            for jj=1:7   %偏差变化率EC的模糊规则控制
                A_rulelist = rulelist(iijj); %查模糊规则表
                %******计算C1A‘************
                A = E(ii:);      %取A‘    
                C_A = U(A_rulelist:);     %取Ci     
                for i=1:13     %求R1A
                    for j=1:13
                        if(A(i) > C_A(1j))
                            Ra(ij) = C_A(1j);
                        else 
                            Ra(ij) = A(i);
                        end
                    end
                end

                AA = zeros(113); %取AA=A‘ 
                %AA(1iii) = E(iiiii);       
                AA(1iii) = 1;
                               
                for i=1:13      %先取小
                    for j=1:13  
                        if(AA(j) > Ra(ji))
                             A_qux(ji) = Ra(ji);
                        else
                             A_qux(ji) = AA(j);
                        end
                    end
                end

                for i=1:13     %再取大,,,求和CiA
                    max = A_qux(1i);
                    for j=1:13
                        if(max < A_qux(ji))
                            max = A_qux(ji);
      

评论

共有 条评论