Fuzzy Operation (Add, subtract, multiply, and divide) without using the built-in matlab function?

I'm trying to do the fuzzy operations of 2 specific functions f1 and f2 where
f1 = gaussmf(x, [2 2]); f2 = gaussmf(x, [3 6]);
since fuzzy addition has x-values from the lower and upper limits of x from two functions [a,b]+[d,e] = [a+d, b+e]
I have to do this for 100 y-values from 0 to 1.
Has anyone tried to do this?
thank you

Réponses (2)

Hi Soloby,
What's y all of a sudden?!

15 commentaires

sorry for not clearly stating it. since both of my f1 and f2 have lower and upper bounds of 0 to 1 that's the y-value
You're looking for fuzzy addition. Then just add them.
f3 = gaussmf(x,[2+3,2+6]);
is this what you're looking for!
i have to perform that exact function without using the built-in function itself. i can show you what i have if you want. it somewhat works for adding but not at all for the other 3 operations.
I would appreciate if you provide further info, cuz that what I understood from your question. And I'm still confused what you're looking for.
yeah sure sorry. new to this forum.
my goal of the project is to perform addition, subtraction, division and multiplication of fuzzy operations of any 2 functions without using the built in matlab function.
for example, my first attempt was using 2 functions
f1 = gaussmf(x, [2 2]); f2 = gaussmf(x, [3 6]);
Ultimately, I need to have 4 graphs plotted, 3 of which I have an example using the built in function of matlab
N = 101;
minx = -20;
maxx = 20;
x = linspace(minx,maxx,N);
A = gaussmf(x, [2 2]);
B = gaussmf(x, [3 6]);
Csum = fuzarith(x,A,B,'sum');
Csub = fuzarith(x,A,B,'sub');
Cprod = fuzarith(x,A,B,'prod');
subplot(3,1,1); plot(x,A,'b--',x,B,'m:',x,Csum,'c');
title('Fuzzy Addition, A+B');
legend('A','B','A+B');
subplot(3,1,2); plot(x,A,'b--',x,B,'m:',x,Csub,'c');
title('Fuzzy Subtraction, A-B');
legend('A','B','A-B');
subplot(3,1,3); plot(x,A,'b--',x,B,'m:',x,Cprod,'c');
axis([-20 20 0 1]);
title('Fuzzy Product, A*B');
legend('A','B','A*B');
OK, It's better now. you don't want to use fuzarith() function.
I guess the only trick is with the division perhaps! I'm not sure though. I'm gonna give it a try soon.
I'm thinking the key to this is to use an inverse function of the f1 and f2 (which is why I am thinking a triangular wave function is a lot simpler from the other question you answered) please let me know what you get and thanks very much for your help.
commenting further into this, what I think i have to do is divide both my f1 and f2 of
f1 = trapmf(x, [2 7 7 12]);
f2 = trapmf(x, [4 11 11 18]);
into an n number of y's and get the upper and lower bounds of x-values this way. Do you also think this is the best way to do this?
I'm stock here! with the alpha (a)
See if you can continue from this point.
File is attached, addition and subtraction works fine, the product intervals is ok too but the mf is not! compare it with the matlab built in function
hey. sorry for the late answer. for addition and subtraction looks great. im not sure what mf is?
mf is Membership Function, I assumed we're talking fuzzy logics.
soloby
soloby le 9 Juin 2015
Modifié(e) : soloby le 9 Juin 2015
oh. right. i have a question on your multiplying function,
plot(x,trapmf(x,[multMin,mult(1),mult(2),multMax]));
how did you decide to use mult(1) and mult(2) values for the middle limits of the trapmf?
I'm still trying to work on this..
for multiplying and dividing, I think the key is not to use the trapmf function into our final graphs, but to actually just find the min and max of the lower and upper bounds for each operations. I'm honestly so lost in how to do this
Hi Soloby,
As you said we should not use the same membership function (mf) for the resultant multiplication. The shape of the resulting mf is different from trapmf. How is it different is something I don't know. I don't think if it is that difficult. Search about a-cut (alpha-cut) method in fuzzy arithmetic (or something similar) see if you understand anything.
Please let me know if you made a progress or need help.
Good Luck!
Hello, I am trying to add and subtract two 18X18 matrix containing fuzzy numbers. Could you please suggest how to perform this operation using the matlab?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Fuzzy Logic in Simulink dans Centre d'aide et File Exchange

Question posée :

le 8 Juin 2015

Community Treasure Hunt

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

Start Hunting!

Translated by