Help me with rule code

8 views (last 30 days)
geor
geor on 2 Jun 2014
Edited: geor on 2 Jun 2014
Hello i have one problem i have one system with one input and one output the rule is IF x is A1 then y is PL AlSO IF x is A2 then y is PM ALSO IF x is A3 then y is ZE ALSO IF x is A4 then y is NM ALSO IF x is A5 then y is NL ALSO IF x is A6 then y is NM ALSO IF x is A7 then y is ZE ALSO IF x is A8 then y is PM ALSO IF x is A9 then y is PL
the code ///
x=linspace(0,360,361); y=linspace(-5,5,361); z=5*cos(2*pi*x/360);
[A,B,C]=tri_MF_partition(0,360,9,0.5); for i=1:9 x_mf(i,:)=tri_MF(x,A(i),B(i),C(i));// here i create the A1,A2,A3,A4,A5,A6,A7,A8,A9 end
[A,B,C]=tri_MF_partition(-5,5,5,g); for i=1:5
y_mf(i,:)=tri_MF(y,A(i),B(i),C(i));//here i create the PL,NM,ZE,NL,NM end
how make fuzzification COA? i know there is a matlab programma (fuzzy) but i want make that with matlab code thank you

Accepted Answer

geor
geor on 2 Jun 2014
Edited: geor on 2 Jun 2014
i must make that results.
I must use Mamdani and for also i must use max
and find w1,w2,w3..w9 and c1,c2,c3..c9 and ctotal=max(c1,c2,...c9)

More Answers (0)

Categories

Find more on Fuzzy Logic Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!