LAT Hologramm-Software 2.0
Loading...
Searching...
No Matches
gaussmf.m
Go to the documentation of this file.
1function y = gaussmf(x, params) %#codegen
2%GAUSSMF Gaussian curve membership function.
3% GAUSSMF(X, PARAMS) returns a matrix which is the Gaussian
4% membership function evaluated at X. PARAMS is a 2-element vector
5% that determines the shape and position of this membership function.
6% Specifically, the formula for this membership function is:
7%
8% GAUSSMF(X, [SIGMA, C]) = EXP(-(X - C).^2/(2*SIGMA^2));
9%
10% For example:
11%
12% x = (0:0.1:10)';
13% y1 = gaussmf(x, [0.5 5]);
14% y2 = gaussmf(x, [1 5]);
15% y3 = gaussmf(x, [2 5]);
16% y4 = gaussmf(x, [3 5]);
17% subplot(211); plot(x, [y1 y2 y3 y4]);
18% y1 = gaussmf(x, [1 2]);
19% y2 = gaussmf(x, [1 4]);
20% y3 = gaussmf(x, [1 6]);
21% y4 = gaussmf(x, [1 8]);
22% subplot(212); plot(x, [y1 y2 y3 y4]);
23% set(gcf, 'name', 'gaussmf', 'numbertitle', 'off');
24%
25% See also DSIGMF,EVALMF, GAUSS2MF, GBELLMF, PIMF, PSIGMF, SIGMF,
26% SMF, TRAPMF, TRIMF, ZMF.
27
28% Copyright 1994-2018 The MathWorks, Inc.
29
30%fuzzy.internal.utility.validateGaussMFParameterValues(params)
31
32sigma = cast(params(1),'like',x);
33c = cast(params(2),'like',x);
34y = exp(-(x - c).^2/(2*sigma^2));
35
36end
function gaussmf(in x, in params)