File: gauss2mf.html

package info (click to toggle)
octave-fuzzy-logic-toolkit 0.6.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,024 kB
  • sloc: makefile: 147
file content (180 lines) | stat: -rw-r--r-- 7,281 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Octave Fuzzy Logic Toolkit: gauss2mf</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" integrity="sha512-1ycn6IcaQQ40/MKBW2W4Rhis/DbILU74C1vSrLJxCq57o941Ym01SwNsOMqvEBFlcgUa6xLiPY/NS5R+E6ztJQ==" crossorigin="anonymous" referrerpolicy="no-referrer">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css" integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-U1DAWAznBHeqEIlVSCgzq+c9gqGAJn5c/t99JyeKa9xxaYpSvHU5awsuZVVFIhvj" crossorigin="anonymous"></script>
    <script type="text/javascript" async
      src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML">
    </script>
    <style>
    var {
      font-style: italics;
      font-weight: bold;
    }
    td {
      vertical-align: top;
    }
    </style>
  </head>
  <body>
    <div class="bg-dark">
      <div class="container-xl">
        <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
          <div class="container-fluid">
            <a class="navbar-brand" href=index.html>
              <img src="assets/fuzzy-logic-toolkit.png" alt="fuzzy-logic-toolkit" class="d-inline-block align-top" width="25" height="25">
              Octave Fuzzy Logic Toolkit
            </a>
            <button type="button" class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
              <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
              <ul class="navbar-nav">
                <li class="nav-item">
                  <a class="nav-link" href="index.html#Membership Functions">
                    <i class="fas fa-list-alt"></i>
                    Membership Functions
                  </a>
                </li>
                <li class="nav-item">
                  <a class="nav-link" href="https://gnu-octave.github.io/packages/">
                  <img src="assets/octave-logo.svg" alt="GNU Octave logo" class="d-inline-block align-top" width="25" height="25">
                    Octave Packages
                  </a>
                </li>
                <li class="nav-item">
                  <a class="nav-link" href="https://www.octave.org">
                    <i class="fas fa-home"></i>
                    GNU Octave website
                  </a>
                </li>
              </ul>
            </div>
          </div>
        </nav>
      </div>
    </div>
    <div class="container-xl my-4">
      <div class="card rounded">
        <div class="card-header card-header-mod">
          <div class="row d-flex flex-wrap align-items-center">
            <div class="col-sm-3 col-md-5 mb-2 mb-sm-0">
              <h3 class="d-inline-block mr-2">
              Function&nbsp;Reference: <b><code>gauss2mf</code></b>
              </h3>
            </div>
          </div>
        </div>
        <div class="card-body">
<dl>
<dt><u>Function File:</u> <var>y</var> = <b>gauss2mf</b><i> (<var>x</var>, <var>params</var>)</i></dt>
<dt><u>Function File:</u> <var>y</var> = <b>gauss2mf</b><i> (<var>[x1 x2 ... xn]</var>, <var>[sig1 c1 sig2 c2]</var>)</i></dt>
</dl>

<p> For a given domain <var>x</var> and parameters <var>params</var> (or
 <var>[sig1 c1 sig2 c2]</var>), return the corresponding <var>y</var> values for the
 two-sided Gaussian composite membership function. This membership function is
 a smooth curve calculated from two Gaussian membership functions as follows:
</p>
<div class="ms-5">
<p> Given parameters <var>sig1</var>, <var>c1</var>, <var>sig2</var>, and <var>c2</var>, that define
 two Gaussian membership functions, let:
</p>
<pre class="verbatim">     f1(x) = exp((-(x - c1)^2)/(2 * sig1^2))    if x &lt;= c1
             1                                  otherwise

     f2(x) = 1                                  if x &lt;= c2
             exp((-(x - c2)^2)/(2 * sig2^2))    otherwise
 </pre>
<p> Then gauss2mf is given by:
</p>
<pre class="verbatim">     f(x) = f1(x) * f2(x)
 </pre>
<p> The argument <var>x</var> must be a real number or a non-empty vector of strictly
 increasing real numbers, and <var>sig1</var>, <var>c1</var>, <var>sig2</var>, and <var>c2</var>
 must be real numbers.
 Gauss2mf always returns a continuously differentiable curve with values in
 the range [0, 1]. 
</p>
<p> If <var>c1</var> &lt; <var>c2</var>, gauss2mf is a normal membership function (has a
 maximum value of 1), with the rising curve identical to that of f1(x) and a
 falling curve identical to that of f2(x), above. If <var>c1</var> &gt;= <var>c2</var>,
 gauss2mf returns a subnormal membership function (has a maximum value less
 than 1).
</p>
<p> To run the demonstration code, type &quot;<tt>demo gauss2mf</tt>&quot; (without the quotation
 marks) at the Octave prompt.
</p>
<p> <strong>See also: </strong>
  <a href="dsigmf.html">dsigmf</a>, 
  <a href="gaussmf.html">gaussmf</a>, 
  <a href="gbellmf.html">gbellmf</a>, 
  <a href="pimf.html">pimf</a>, 
  <a href="psigmf.html">psigmf</a>, 
  <a href="sigmf.html">sigmf</a>, 
  <a href="smf.html">smf</a>, 
  <a href="trapmf.html">trapmf</a>, 
  <a href="trimf.html">trimf</a>, 
  <a href="zmf.html">zmf</a>
</p>
</div>
        <div class="container-xl my-4">
          <div class="card rounded">
            <div class="card-header card-header-mod">
              <div class="row d-flex flex-wrap align-items-center">
                <div class="col-sm-3 col-md-5 mb-2 mb-sm-0">
                  <h3 class="d-inline-block mr-2">
                  Example: 1
                  </h3>
                </div>
              </div>
            </div>
            <div class="card-body">
              <div class="container bg-light">
                <div class="row">
                  <table><tbody><tr>
                    <td>&nbsp;</td>
                    <td><pre class="example">

 x = -10:0.2:10;
 params = [3 0 1.5 2];
 y1 = gauss2mf(x, params);
 params = [1.5 0 3 2];
 y2 = gauss2mf(x, params);
 params = [1.5 2 3 0];
 y3 = gauss2mf(x, params);
 figure('NumberTitle', 'off', 'Name', 'gauss2mf demo');
 plot(x, y1, 'r;params = [3 0 1.5 2];', 'LineWidth', 2);
 hold on ;
 plot(x, y2, 'b;params = [1.5 0 3 2];', 'LineWidth', 2);
 hold on ;
 plot(x, y3, 'g;params = [1.5 2 3 0];', 'LineWidth', 2);
 ylim([-0.1 1.1]);
 xlabel('Crisp Input Value', 'FontWeight', 'bold');
 ylabel('Degree of Membership', 'FontWeight', 'bold');
 grid;
 hold;

                    </pre></td></tr></tbody>
                  </table>
                  <div class="text-center">
                    <img src="assets/gauss2mf_101.png" class="rounded img-thumbnail" alt="plotted figure">
                  </div><p></p>

                </div>
              </div>
            </div>
          </div>
        </div>


        </div>
      </div>
    </div>

  </body>
</html>