FIS, Fuzzy Inference System in Matlab


If you want to implement FIS in matlab, you can write down like the code below:


function Result = FISBuah(a,b)

buah= newfis(‘Tingkat_Kematangan’);

buah= addvar(buah, ‘input’, ‘Warna’, [0 20]);
buah= addmf(buah, ‘input’, 1, ‘Hijau’, ‘trapmf’, [10 10 15 20]);
buah= addmf(buah, ‘input’, 1, ‘Hijau_muda’, ‘trimf’, [0 8 15]);

buah= addvar(buah, ‘input’, ‘Tekstur’, [0 20]);
buah= addmf(buah, ‘input’, 2, ‘Lunak’, ‘trapmf’, [0 10 10 20]);
buah= addmf(buah, ‘input’, 2, ‘Keras’, ‘trapmf’, [5 10 15 20]);

buah= addvar(buah, ‘output’, ‘Kematangan’, [0 25]);
buah= addmf(buah, ‘output’, 1, ‘Muda’, ‘trapmf’, [0 10 15 20]);
buah= addmf(buah, ‘output’, 1, ‘Agak_tua’, ‘trapmf’, [10 15 20 22]);
buah= addmf(buah, ‘output’, 1, ‘Tua’, ‘trapmf’, [15 20 25 25]);

rule_buah = [
1 2 1 1 1;
2 1 3 1 1;
2 2 2 1 1;];

buah= addrule(buah, rule_buah);
Result = evalfis([a, b], buah);

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s