典型隶属函数仿真程序:
1. clear all; 2. close all; 3. x = 0:0.1:10; 4. y1 = gaussmf(x, [2 5]); 5. y2 = gbellmf(x, [2 4 6]); 6. y3 = sigmf(x, [2 4]); 7. y4 = trapmf(x, [1 5 7 8]); 8. y5 = trimf(x, [3 6 8]); 9. y6 = zmf(x,[3 7]); 10. plot(x,y1,'-*r',x,y2,'-b',x,y3,'og',x,y4,':c',x,y5,'-.m',x,y6,'--k'); 11. legend('高斯','广义钟形','S形','梯形','三角形','Z形')