声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 3371|回复: 5

[控制理论] 自适应神经模糊系统-matlab的介绍

[复制链接]
发表于 2012-6-6 20:40 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
本帖最后由 牛小贱 于 2015-3-6 11:05 编辑
  1. %  自适应神经模糊系统
  2. % 利用genfis1 函数产生一个两个输入——单个输出的模糊推理系统。其中要求输入隶属度函数分别为PI形(primf)和三角形(trimf)
  3. %分隔数分别为3和7
  4. %fismat = genfis1(data,numMFs,inmftype,outmftype)  %详细看帮助里的gensil

  5. %data=[10*rand(10,1)-5,10*rand(10,1)-5 ,rand(10,1)];
  6. %nuMFs=[3 7];
  7. %mftype=str2mat('pimf','trimf');
  8. %outtype=str2mat('linear');
  9. %fismat=genfis1(data,nuMFs,mftype,outtype);        %anifs()自适应神经模糊系统的建模函数
  10. %返回结果是生成的模糊推理系统矩阵
  11. % plotmf(fismat,'input',1);           % Plot all membership functions for given variable
  12.                                     % plotmf(fismat,varType,varIndex)
  13. %在matlab 中提供了基于Taagi——Sugeno 型的自适应神经模糊推理系统ANFIS 的建模方法、该方法利用BP算法
  14. %最小二乘算法来完成对输入。输出数据的建模。通过学习可以计算出隶属度函数的最佳参数,是的设计出来的Taagi——Sugeno 型
  15. %模糊推理系统能够最好的模拟希望的或者实际的输出、输入关系、
  16. %调用格式
  17. %[fis,error,stepsize,chkFis,chkErr] = anfis(trnData,numMFs,trnOpt,dispOpt,chkData,optMethod)
  18. %说明:1)trnData: the name of a training data set. This matrix contains data input in all
  19. %      but the last column. The last column contains a single vector of
  20. %      output data.仅支持多输入单输出情况
  21. %  2)initFis: the name of a fuzzy inference system (FIS) used to provide anfis with an initial
  22. %         set of membership functions for training. Without this option,事先用genfis1
  23. %   3) trnOpt: a vector of training options. When a training option is entered as NaN, the default
  24. %           tions is in force. These options are as follows:
  25. %            trnOpt(1): training epoch number (default: 10)
  26. %           trnOpt(2): training error goal (default: 0)
  27. %           trnOpt(3): initial step size (default: 0.01)
  28. %           trnOpt(4): step size decrease rate (default: 0.9)
  29. %            trnOpt(5): step size increase rate (default: 1.1)
  30. %          fis 为相对的系统            具体的看帮助

  31. %例子:

  32. x=0:1:10;Y=sin(2*x);
  33. trndata=[x 'Y'];                             %组成训练数据
  34. nummfs=5;mftype=str2mat('gbellmf');        %输入隶属度函数的个数、类型
  35. %outtype=str2mat('linear');                  %输出通常是默认linear
  36. inifis=genfis1(trndata,nummfs,mftype)      %初始模糊推理系统
  37.                                          %训练的次数
  38. trnopt=[20,0,0.01,0.9,1.1];
  39. optmethod=1;
  40. [fismat,error]=anfis(trndata,inifis,trnopt,[],[],optmethod);
  41. Y1=evalfis(x,fismat);
  42. plot(x,Y,'b',x,Y1,':');grid on
  43. legend('training data','Anifs ooutput')
复制代码


点评

赞成: 4.0
赞成: 4
好东西~  发表于 2015-3-6 11:05

评分

1

查看全部评分

回复
分享到:

使用道具 举报

发表于 2013-3-20 15:59 | 显示全部楼层
东西很好,虽然现在我还看不太懂,我相信我以后未用到的。谢谢楼主分享。。
发表于 2013-12-5 11:04 | 显示全部楼层
正在学习中
发表于 2014-10-8 23:05 | 显示全部楼层
谢谢谢谢~~~~~~~~~~~~
发表于 2015-3-6 01:44 | 显示全部楼层
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-4-30 07:19 , Processed in 0.132457 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表