How to obtain the fuzzy input membership grades for all MFs given an input value

5 ビュー (過去 30 日間)
mhilmi
mhilmi 2013 年 7 月 2 日
回答済み: Sam Chak 2025 年 4 月 16 日
Hi and Good Day all,
I need your help in the following:
When we evaluate a set of input, either using evalfis function or through the FIS Editor menu of View->Rules, how do we get the input's membership grades for each input membership functions that we have? Let say I have 3 input membership functions ie. Good, Moderate and Poor. So how do I get the grades for all of these 3 MF. The evalfis and View->Rules menu only display the output results. I also found out that I have the similar problem to get the grades of the input MF in the Interval Type-2 Fuzzy Toolbox.
I really hope to get some help from the group. Thank you very much in advance for your time and concern.

回答 (1 件)

Sam Chak
Sam Chak 2025 年 4 月 16 日
Other than the evalfis() function, the evalmf() function can be used to obtain the membership function values.
%% initialize the FIS type
fis = mamfis;
%% add fuzzy variable
fis.Inputs(1) = fisvar([0 10], "Name", "Performance");
%% add fuzzy membership functions
fis.Inputs(1).MembershipFunctions(1) = fismf("linzmf", [2 5 ], "Name", "Poor");
fis.Inputs(1).MembershipFunctions(2) = fismf( "trimf", [2 5 8], "Name", "Moderate");
fis.Inputs(1).MembershipFunctions(3) = fismf("linsmf", [ 5 8], "Name", "Good");
%% evaluate multiple MFs to get the membership function values
xinput = 6;
MFs_mu = evalmf(fis.Inputs(1).MembershipFunctions, xinput)
MFs_mu = 3×1
0 0.6667 0.3333
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
%% plot results
figure
hold on
plotmf(fis, 'input', 1, 1001), ylim([-0.5, 1.5])
grid on, title('Input fuzzy sets')
plot(xinput, MFs_mu(2), 'ko')
plot(xinput, MFs_mu(3), 'ko')
hinput = line([xinput xinput], [-0.2 1.0], 'Color', '#7F7F7F', 'LineStyle','--');
tinput = text(xinput-0.5, -0.25,' input', 'FontWeight', 'bold');
hold off

カテゴリ

Help Center および File ExchangeFuzzy Logic Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by