正文

模糊控制-隶属函数2006-09-26 12:10:00

【评论】 【打印】 【字体: 】 本文链接:http://blog.pfan.cn/378121200/18822.html

分享到:

%典型隶属函数仿真程序:3_2.m
%Membership function
clear all;
clear all;
for (M=1:1:6)
%M=6;
if M==1                 %(高斯型隶属函数)
    x=0:0.1:10;
    y=gaussmf(x,[2 5]);
 %   figure(1);
       subplot(3,2,1);%
    plot(x,y,'k');   
    xlabel('x');ylabel('y');
    title('Guassian membership function');

   
elseif M==2                 %(广义钟型隶属函数)
    x=0:0.1:10;
    y=gbellmf(x,[2 4 6]);
%   figure(1);
    subplot(3,2,2);%分割图形窗口
    plot(x,y,'b');
    xlabel('x');ylabel('y');
    title('General Bell membership function');

elseif M==3                 %(S型隶属函数)
    x=0:0.1:10;
    y=sigmf(x,[2 4]);
%    figure(3);
        subplot(3,2,3);%
    plot(x,y,'g');
    xlabel('x');ylabel('y');
    title('S membership function');


elseif M==4                %(梯型隶属函数)
    x=0:0.1:10;
    y=trapmf(x,[2 5 7 8]);
%    figure(4);
     subplot(3,2,4);%
    plot(x,y,'r');
    xlabel('x');ylabel('y');
    title('Trapezoid membership function');


elseif M==5                 %(三角型隶属函数)
    x=0:0.1:10;
    y=trimf(x,[3 6 8]);
 %   figure(5);
    subplot(3,2,5);%
    plot(x,y,'c');
    xlabel('x');ylabel('y');
    title('Triangle membership function');


elseif M==6                 %(z型隶属函数)
    x=0:0.1:10;
    y=zmf(x,[3 7]);
%   figure(6);
   subplot(3,2,6);%
    plot(x,y,'m');
    xlabel('x');ylabel('y');
    title('Z membership function') ;
end
end
   

 

阅读(5457) | 评论(0)


版权声明:编程爱好者网站为此博客服务提供商,如本文牵涉到版权问题,编程爱好者网站不承担相关责任,如有版权问题请直接与本文作者联系解决。谢谢!

评论

暂无评论
您需要登录后才能评论,请 登录 或者 注册