TO PERFORM UNION, INTERSECTION AND COMPLIMENT OPERATIONS > Matlab
TO PERFORM UNION, INTERSECTION AND COMPLIMENT OPERATIONS > Matlab
Soft Computing
Program:
%Enter Data
u=input('ENTER THE FIRST MATRIX');
v=input('ENTER THE SECOND MATRIX');
%To Perform Operations
w=max(u,v);
p=min(u,v);
q1=1-u;
q2=1-v;
%Display Output
display('Union of two matrices');
display(w);
display('Intersection of two
matrices');
display(p);
display('Compliment of First
matrix');
display(q1);
display('Compliment of Second
matrix');
display(q2);
OUTPUT :
ENTER THE FIRST MATRIX [0.3 0.4]
ENTER THE SECOND MATRIX [0.1 0.7]
Union of two matrices
w =
0.3000 0.7000
Intersection of two matrices
p =
0.1000 0.4000
Compliment of First matrix
q1 =
0.7000 0.6000
Compliment of Second matrix
q2 =
0.9000 0.3000
Comments
Post a Comment