31.10.2014 Views

What Is Fuzzy Logic?

What Is Fuzzy Logic?

What Is Fuzzy Logic?

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

trimf<br />

Purpose<br />

Syntax<br />

Description<br />

Triangular-shaped built-in membership function<br />

y = trimf(x,params)<br />

y = trimf(x,[a b c])<br />

The triangular curve is a function of a vector, x, and depends on three<br />

scalar parameters a, b, andc, asgivenby<br />

( ) =<br />

f x; a, b,<br />

c<br />

⎧ 0,<br />

⎪<br />

⎪<br />

x−<br />

a<br />

,<br />

⎪b−<br />

a<br />

⎨<br />

⎪ c−<br />

x<br />

,<br />

⎪ c−<br />

b<br />

⎪<br />

⎩ 0,<br />

x ≤ a ⎫<br />

⎪<br />

a ≤ x ≤ b⎪<br />

⎪<br />

⎬<br />

b≤<br />

x ≤ c⎪<br />

⎪<br />

c ≤ x<br />

⎪<br />

⎭<br />

or, more compactly, by<br />

f ( x a c x<br />

x; a, b, c ) = ⎛ ⎛ − − ⎞<br />

max⎜min ⎜ , ⎟,<br />

⎝ ⎝ b−<br />

a c−<br />

b⎠<br />

o ⎞<br />

⎟<br />

⎠<br />

The parameters a and c locate the “feet” of the triangle and the<br />

parameter b locates the peak.<br />

Examples<br />

x=0:0.1:10;<br />

y=trimf(x,[3 6 8]);<br />

plot(x,y)<br />

xlabel('trimf, P=[3 6 8]')<br />

4-90

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!