How can I use custom membership functions in ANFIS?

3 ビュー (過去 30 日間)
Tooba Shelkh
Tooba Shelkh 2022 年 6 月 26 日
コメント済み: Amritesh 2022 年 6 月 26 日
I am trying to use custom MFs in anfis, instead of the preset bellMF?
I have followed the steps in this link, but how do I use it afterwards in my code?
For example in the example provided, we have:
load fuzex1trnData.dat
fis = anfis(fuzex1trnData);
Now how do I use the FIS (customfis) with the custom MF that I created using FuzzyLogicDesigner?
Any help is appreciated.

回答 (1 件)

Amritesh
Amritesh 2022 年 6 月 26 日
If you have already made FIS, then use fis = anfis(trainingData,options) and in options use that custom FIS.
If not then, first add custom membership function to a FIS like
myFIS = addMF(myFIS,"input1","custmf1",[0 1 2 4 6 8 9 10],'Name',"customMF1");
Documentation Links:
  1. https://in.mathworks.com/help/fuzzy/building-fuzzy-inference-systems-using-custom-functions.html
  2. https://in.mathworks.com/help/fuzzy/anfis.html
Hope this solves your problem.
  2 件のコメント
Tooba Shelkh
Tooba Shelkh 2022 年 6 月 26 日
I want to train ANFIS on my custom MF. It is not allowing me to do that, it requires me to add built-in MF for that purpose. It does not generate the rules from my custom MF.
Amritesh
Amritesh 2022 年 6 月 26 日
You can define an initial FIS structure using genfisOptions
genOpt = genfisOptions('GridPartition');
genOpt.NumMembershipFunctions = num;
genOpt.InputMembershipFunctionType = 'cumstomMF1'; % Here you use your custom MF
inFIS = genfis(x,y,genOpt);
You can use name of a custom membership function in the current working folder or on the MATLAB® path in InputMembershipFunctionType.
And, then configure the ANFIS training options
opt = anfisOptions('InitialFIS',inFIS);

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeFuzzy Inference System Tuning についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by