help me in degree of membership function correction in fuzzy logic tool with new membership function creation

3 views (last 30 days)
function y = nf1(x, params) if nargin ~= 2 error('Two arguments are required by the Normal PDF MF.'); elseif length(params) < 2 error('The Normal PDF MF needs at least four parameters.'); end
sigma1 = params(1); c1 = params(2);
end r1 = exp(-(x-c1).^2 ./ (2 .* sigma1 .^2)) ./ (sigma1 .* (sqrt(2*pi)));
the above code changed using that formula. but, here the curve is not fitting in the 0 to 1 interval. so, please help me fuzzy experts...
Thanking you

Answers (1)

Sam Chak
Sam Chak on 17 Sep 2022
That's because the amplitude of your custom function depends on the value of σ. If it is not designed as , then the upper bound of the function is not at .
In your case, the chosen custom function is a Normal Distribution function:
where
the amplitude, .
To make sure that the custom function bounded , then the function has to be carefully designed.
For example, guarantees that .
x = linspace(-1, 1, 20001);
sigma = 1/sqrt(2*pi);
center = 0;
mf1 = custmf(x, [sigma center]);
plot(x, mf1), grid on, ylim([-0.1 1.1])
text(-0.05, 1.05, 'mf1')
xlabel('Universe of Discourse, \it{x}')
ylabel('Degree of membership, \mu(\it{x})')
% Custom Membership Function -- Normal distribution
function mf = custmf(x, params)
sigma = params(1);
c = params(2);
mf = exp(-1/2*((x - c)/sigma).^2) / (sigma*(sqrt(2*pi)));
% mf = exp(-(x - c).^2./(2*sigma^2)); <-- the same as gaussmf()
end

Categories

Find more on Fuzzy Inference System Modeling in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!