0% found this document useful (0 votes)
56 views13 pages

Theory Assignment-SC

The document discusses calculating various operations on two fuzzy sets A(x) and B(x). It provides the membership functions for A(x) and B(x) and then calculates: (1) the scalar cardinality, (2) complements, (3) intersection, (4) union, (5) algebraic product, (6) multiplication by a crisp value, (7) concentration and dilation, and (8) various algebraic operations including sum, difference, bounded sum, and bounded difference. For each operation, it provides the resulting membership functions or values and generates graphical representations.

Uploaded by

Dj Das
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views13 pages

Theory Assignment-SC

The document discusses calculating various operations on two fuzzy sets A(x) and B(x). It provides the membership functions for A(x) and B(x) and then calculates: (1) the scalar cardinality, (2) complements, (3) intersection, (4) union, (5) algebraic product, (6) multiplication by a crisp value, (7) concentration and dilation, and (8) various algebraic operations including sum, difference, bounded sum, and bounded difference. For each operation, it provides the resulting membership functions or values and generates graphical representations.

Uploaded by

Dj Das
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Assignment

Q) Let us consider the two following Fuzzy Sets:


A(x) = {(x1,0.15),(x2,0.27),(x3,0.47),(x4,0.57)}
B(x) = {(x1,0.35),(x2,0.48),(x3,0.58),(x4,0.69)}

Determine:

(a) Scalar cardinality of the given fuzzy sets.


Solution:
% Defining fuzzy set A
mfa=[0.15 0.27 0.47 0.57];
a=[1 2 3 4];
% Defining fuzzy set B
mfb=[0.35 0.48 0.58 0.69];
b=[1 2 3 4];

%Scalar cardinality=sum of membership functions.

sca = sum(mfa);
scb = sum(mfb);
Result:
>>scalar_cardinality
sca =
1.4600
scb =
2.1000

(b) A-compliment and B-compliment


Solution:
% Defining fuzzy set A
mfa=[0.15 0.27 0.47 0.57];
a=[1 2 3 4];
% Defining fuzzy set B
mfb=[0.35 0.48 0.58 0.69];
b=[1 2 3 4];

%Compliment of A & B
comp_a = 1-mfa
comp_b = 1-mfb

stem(a, comp_a,'*');
axis([0 5 0 1]);
xlabel('X-->');
ylabel('Membership Grades');
title('Compliment of Set A (190310194)');
figure
stem(a, comp_b,'*');
axis([0 5 0 1]);
xlabel('X-->');
ylabel('Membership Grades');
title('Compliment of Set B (190310194)');
Result:
>>compliment_a_b
comp_a =
0.8500 0.7300 0.5300 0.4300
comp_b =
0.6500 0.5200 0.4200 0.3100
Figure:
(c) Intersection of A(x) and B(x)
Solution:
% Defining fuzzy set A
mfa=[0.15 0.27 0.47 0.57];
a=[1 2 3 4];
% Defining fuzzy set B
mfb=[0.35 0.48 0.58 0.69];
b=[1 2 3 4];

%Intersection = min(mfa,mfb)

intersect = min(mfa,mfb)

stem(a, intersect,'*');
axis([-1 5 0 0.6]);
xlabel('X-->');
ylabel('Membership Grades');
title('Intersection of Set A & B (190310194)');
Result:
>> intersection
intersect =
0.1500 0.2700 0.4700 0.5700
Figure:
(d) Union of A(x) and B(x)
Solution:
% Defining fuzzy set A
mfa=[0.15 0.27 0.47 0.57];
a=[1 2 3 4];
% Defining fuzzy set B
mfb=[0.35 0.48 0.58 0.69];
b=[1 2 3 4];

%Union = max(mfa,mfb)

uni = max(mfa,mfb)

stem(a, uni,'*');
axis([-1 5 0 0.8]);
xlabel('X-->');
ylabel('Membership Grades');
title('Union of Set A & B (190310194)');
Result:
>> union
uni =
0.3500 0.4800 0.5800 0.6900

Figure:
(e) Algebraic Product of A(x) and B(x)
Solution:
% Defining fuzzy set A
mfa=[0.15 0.27 0.47 0.57];
a=[1 2 3 4];
% Defining fuzzy set B
mfb=[0.35 0.48 0.58 0.69];
b=[1 2 3 4];

%Algebraic Product = mfa.*mfb

algProduct = mfa.*mfb

stem(a, algProduct,'*');
axis([-1 5 0 0.5]);
xlabel('X-->');
ylabel('Membership Grades');
title('Algebraic product of Set A & B (190310194)');
Result:
>>algebraic_Product
algProduct =
0.0525 0.1296 0.2726 0.3933
Figure:
(f) D.A(x) and d.B(x), where d=0.3 is crisp number.
Solution:
% Defining fuzzy set A
mfa=[0.15 0.27 0.47 0.57];
a=[1 2 3 4];
% Defining fuzzy set B
mfb=[0.35 0.48 0.58 0.69];
b=[1 2 3 4];

crisp = 0.3;
mulCrispA = crisp.*mfa
mulCrispB = crisp.*mfb

stem(a, mulCrispA,'*');
axis([-1 5 0 0.3]);
xlabel('X-->');
ylabel('Membership Grades');
title('Multiplication of fuzzy set A by a crisp Number
(190310194)');
figure
stem(a, mulCrispB,'*');
axis([-1 5 0 0.3]);
xlabel('X-->');
ylabel('Membership Grades');
title('Multiplication of fuzzy set B by a crisp Number
(190310194)');
Result:
>>mul_Crisp
mulCrispA =
0.0450 0.0810 0.1410 0.1710
mulCrispB =
0.1050 0.1440 0.1740 0.2070

Figure:
(g) Concentration and Dilation of A(x) and B(x)
Solution:
% Defining fuzzy set A
mfa=[0.15 0.27 0.47 0.57];
a=[1 2 3 4];
% Defining fuzzy set B
mfb=[0.35 0.48 0.58 0.69];
b=[1 2 3 4];

power = 2;
concentration = power;
dialation = 1/power;

concentrationA = mfa.^concentration
concentrationB = mfb.^concentration
dialationA = mfa.^dialation
dialationB = mfb.^dialation

plot(a, concentrationA,'-');
hold on
plot(a, dialationA,'-');
hold off
axis([0 5 0 1]);
xlabel('X-->');
ylabel('Membership Grades');
legend({'dialation','concentration'})
title('Concentration &Dialation of fuzzy set A
(190310194)');
figure
plot(b, concentrationB,'-');
hold on
plot(b, dialationB,'-');
hold off

axis([0 5 0 1]);
xlabel('X-->');
ylabel('Membership Grades');
legend({'dialation','concentration'})
title('Concentration &Dialation of fuzzy set B
(190310194)');

Result:
>>concentration_dialation
concentrationA =
0.0225 0.0729 0.2209 0.3249
concentrationB =
0.1225 0.2304 0.3364 0.4761
dialationA =
0.3873 0.5196 0.6856 0.7550
dialationB =
0.5916 0.6928 0.7616 0.8307
Figure:

(h) Algebraic sum of A(x) and B(x)


Solution:
% Defining fuzzy set A
mfa=[0.15 0.27 0.47 0.57];
a=[1 2 3 4];
% Defining fuzzy set B
mfb=[0.35 0.48 0.58 0.69];
b=[1 2 3 4];

%Algebraic sum
algeb_sum = mfa+mfb-(mfa.*mfb)

stem(a, algeb_sum,'*');
axis([0 5 0 1]);
xlabel('X-->');
ylabel('Membership Grades');
title('Algebraic Sum of Set A & B (190310194)');
Result:
>>algebraic_sum
algeb_sum =
0.4475 0.6204 0.7774 0.8667
Figure:

(i) Bounded sum of A(x) and B(x)


Solution:
% Defining fuzzy set A
mfa=[0.15 0.27 0.47 0.57];
a=[1 2 3 4];
% Defining fuzzy set B
mfb=[0.35 0.48 0.58 0.69];
b=[1 2 3 4];

%Bounded sum
bound_sum = min(1,(mfa+mfb))

stem(a, bound_sum,'*');
axis([0 5 0 1.2]);
xlabel('X-->');
ylabel('Membership Grades');
title('Bounded Sum of Set A & B (190310194)');
Result:
>>bounded_sum
bound_sum =
0.5000 0.7500 1.0000 1.0000
Figure:
(j) Algebraic sum of A(x) and B(x)
Solution:
% Defining fuzzy set A
mfa=[0.15 0.27 0.47 0.57];
a=[1 2 3 4];
% Defining fuzzy set B
mfb=[0.35 0.48 0.58 0.69];
mfb_comp = 1.-mfb
b=[1 2 3 4];

%Algebraic Difference
algeb_diff = min(mfa,mfb_comp)

stem(a, algeb_diff,'*');
axis([0 5 0 0.5]);
xlabel('X-->');
ylabel('Membership Grades');
title('Algebraic Differnce of Set A & B (190310194)');
Result:
>>algebraic_difference
mfb_comp =
0.6500 0.5200 0.4200 0.3100
algeb_diff =
0.1500 0.2700 0.4200 0.3100
Figure:
(k) Bounded difference of A(x) and B(x)
Solution:
% Defining fuzzy set A
mfa=[0.15 0.27 0.47 0.57];
a=[1 2 3 4];
% Defining fuzzy set B
mfb=[0.35 0.48 0.58 0.69];
b=[1 2 3 4];

%Bounded difference
bound_diff = max(0,(mfa+mfb-1))

stem(a, bound_diff,'*');
axis([0 5 0 0.4]);
xlabel('X-->');
ylabel('Membership Grades');
title('Bounded Difference of Set A & B (190310194)');
Result:
>>bounded_difference
bound_diff =
0 0 0.0500 0.2600
Figure:

You might also like