No BSD License  

Highlights from
type2_union_or_intersection

from type2_union_or_intersection by C. Jeganathan Pillai
In order to evaluate union or intersection operation under type2.

type2_union_or_intersection(u,v,option)
% THIS FUNCTION IS DEVELOPED BY C. JEGANATHAN, IIRS, DEPT. OF SPACE
% 4 KALIDAS ROAD, DEHRADUN, INDIA

%THIS FUNCTION IS USED TO CALCULATE UNION OR INTERSECTION OF 
% ANY INPUT TYPE-2 FUZZY SETS
% THE INPUT FUZZY SETS MUST CONSISTS OF 2 COLUMNS
% THE FIRST COLUMN REPRESENTS THE PRIMARY MEMBERSHIP VALUES
% THE SECOND COLUMN REPRESENTS THE CORRESPONDING SECONDARY GRADES (uncertainty)
% output will be A MATRIX WITH COLUMN
%  FIRST COLUMN REPRESENTS the combined PRIMARY MEMBERSHIP
%  SECOND COLUMN REPREESNTS the combined SECONDARY GRADES
% if OPTION value is 1 then the operation of UNION will be done
% if OPTION value is 2 then INTERESECTION opERATION WILL BE DONE
% "output" will have two columns first column is shows the resultant values
% of primary memberships and second column will show the corresponding
% uncertainty value...
% 

%IMPORTANT NOTE:
% MY ALL SUBMITTED FUNCTIONS MAY, IN A VERY SMALL WAY, HELP TO REPRESENT DR. JERRY MENDEL and
% HIS PH.D STUDENTS PIONEERING WORK ON TYPE2-FUZZY LOGIC SYSTEMS.
% FOR DETAILS PLEASE REFER THE BOOK: 
% Uncertain Rule-Based Fuzzy Logic Systems:Introduction and New Directions
% by Jerry M. Mendel,University of Southern California, Los Angeles, CA
 
% MY SINCERE ACKNOWLEDGEMENT TO DR. JERRY MENDEL AND ALL HIS GREAT STUDENTS
% IN MAKING ME EDUCATED IN TYPE2-FLS.


function [output] = type2_union_or_intersection(u,v,option)


[urow,ucol]=size(u)
[vrow,vcol]=size(v)
%=======THIS IS FOR UNION OPERATION======
if (option == 1) 
for i = 1:urow
for j = 1:vrow
unc(i,j) = min(u(i,2),v(j,2));
prim(i,j) = max(u(i,1),v(j,1));
end
end

end
%===================

%=======THIS IS FOR INTERSECTION OPERATION======

if (option == 2)

for i = 1:urow
for j = 1:vrow
unc(i,j) = min(u(i,2),v(j,2));
prim(i,j) = min(u(i,1),v(j,1));
end
end

end
%===================

uniprim = unique(prim);
len = length(uniprim);


[r,c]=size(prim);
% this loop is to identify the corresponding maximum uncertainty value 
% the particular primary membership output
for i = 1:len
   val = 0;
for j = 1:r*c
   if(prim(j)== uniprim(i))
      prim(j)
      uniprim(i)
      val = max(val,unc(j))
   end
end
maxunc(i) = val;
end

%=======================
   
   
output = [uniprim maxunc'];
return ;

Contact us at files@mathworks.com