📄 dsmt.m
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The coryright belongs to Yang Yang,Automation Institute,NPU,710072
% Xi'an, China
% EDITION NUMBER: 1.0
% Contract me : E-mail yay9096@hotmail.com ,
% Mobile : 13572239439,
% Home : 029-82375332
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function M=DSmT(e1,e2)
% calculate the rule of combination in DSmT, the format is:
% M=DSmT(e1,e2)
% e1,e2: evidences to be combined,they are all vectors for a column.
% M: output combined basic belief assignments for a column,it have 5
% elements for two class and 18 elements for three class.
% Interpretion:
% The function can only calculate two or three classes for the Frame
% within DSmT.If the Frame have two elements, they are denoted in
% Theta={A,B},and if it have three elements,the Theta={A,B,C}. Then the
% D^Theta={0,A&B,A,B,A|B} for two dimensions . Then the rule of
% combination in DSmT can be calculate in matrix .
% Note that the order of e1 and e2 must be set in the order of D^Theta.
% Other Noting ,it has eighteen elements in the D^Theta for three
% class,and it do not have the first 0 in the code order for belief
% representation,you know that it should have nineteen elements in it.You
% should see my document for the order of three class in D^Theta.
% Do not hesitate to contract me ,if you have any question.
[row,col]=size(e1);
%Judge the classes of the Frame
if row==5
class=2;
elseif row==18
class=3;
else disp(['The class number of the Frame is not two or three,the function can not be calculated']);
return;
end
if class==2
Transfer=[0,0,0,0,0;
0,e1(2)+e1(3)+e1(4)+e1(5),e1(2)+e1(4),e1(2)+e1(3),e1(2);
0,0,e1(3)+e1(5),0,e1(3);
0,0,0,e1(4)+e1(5),e1(4);
0,0,0,0,e1(5)];
M=Transfer*e2;
M=M./sum(M);
end
if class==3
Transfer=[sum(e1),e1(1)+e1(3)+e1(4)+e1(5)+e1(11),e1(1)+e1(2)+e1(4)+e1(6)+e1(10),e1(1)+e1(2)+e1(3)+e1(7)+e1(9),e1(1)+e1(2),e1(1)+e1(3),e1(1)+e1(4),e1(1),e1(1)+e1(4),e1(1)+e1(3),e1(1)+e1(2),e1(1),e1(1),e1(1),e1(1),e1(1),e1(1),e1(1);
0,sum(e1)-(e1(1)+e1(3)+e1(4)+e1(5)+e1(11)),0,0,0,e1(2)+e1(7)+e1(9),e1(2)+e1(6)+e1(10),e1(2),e1(2)+e1(6)+e1(10),e1(2)+e1(7)+e1(9),0,e1(2),e1(2),e1(2),e1(2),e1(2),e1(2),e1(2);
0,0,sum(e1)-(e1(1)+e1(2)+e1(4)+e1(6)+e1(10)),0,e1(3)+e1(7)+e1(9),0,e1(3)+e1(5)+e1(11),e1(3),e1(3)+e1(5)+e1(11),0,e1(3)+e1(7)+e1(9),e1(3),e1(3),e1(3),e1(3),e1(3),e1(3),e1(3);
0,0,0,sum(e1)-(e1(1)+e1(2)+e1(3)+e1(7)+e1(9)),e1(4)+e1(6)+e1(10),e1(4)+e1(5)+e1(11),0,e1(4),0,e1(4)+e1(5)+e1(11),e1(4)+e1(6)+e1(10),e1(4),e1(4),e1(4),e1(4),e1(4),e1(4),e1(4);
0,0,0,0,e1(5)+e1(8)+e1(11)+e1(12)+e1(13)+e1(14)+e1(15)+e1(16)+e1(17)+e1(18),0,0,e1(5)+e1(11),0,0,e1(5)+e1(8)+e1(13)+e1(14)+e1(15),e1(5),e1(5)+e1(11),e1(5)+e1(11),e1(5)+e1(11),e1(5),e1(5),e1(5);
0,0,0,0,0,e1(6)+e1(8)+e1(10)+e1(12)+e1(13)+e1(14)+e1(15)+e1(16)+e1(17)+e1(18),0,e1(6)+e1(10),0,e1(6)+e1(8)+e1(12)+e1(14)+e1(16),0,e1(6)+e1(10),e1(6),e1(6)+e1(10),e1(6),e1(6)+e1(10),e1(6),e1(6);
0,0,0,0,0,0,e1(7)+e1(8)+e1(9)+e1(12)+e1(13)+e1(14)+e1(15)+e1(16)+e1(17)+e1(18),e1(7)+e1(9),e1(7)+e1(8)+e1(12)+e1(13)+e1(17),0,0,e1(7)+e1(9),e1(7)+e1(9),e1(7),e1(7),e1(7),e1(7)+e1(9),e1(7);
0,0,0,0,0,0,0,e1(8)+e1(12)+e1(13)+e1(14)+e1(15)+e1(16)+e1(17)+e1(18),0,0,0,e1(8)+e1(13)+e1(14)+e1(15),e1(8)+e1(12)+e1(14)+e1(16),e1(8)+e1(12)+e1(13)+e1(17),e1(8)+e1(12),e1(8)+e1(13),e1(8)+e1(14),e1(8);
0,0,0,0,0,0,0,0,e1(9)+e1(14)+e1(15)+e1(16)+e1(18),0,0,0,0,e1(9),e1(9),e1(9),0,e1(9);
0,0,0,0,0,0,0,0,0,e1(10)+e1(13)+e1(15)+e1(17)+e1(18),0,0,e1(10),0,e1(10),0,e1(10),e1(10);
0,0,0,0,0,0,0,0,0,0,e1(11)+e1(12)+e1(16)+e1(17)+e1(18),e1(11),0,0,0,e1(11),e1(11),e1(11);
0,0,0,0,0,0,0,0,0,0,0,e1(12)+e1(16)+e1(17)+e1(18),0,0,0,e1(12)+e1(17),e1(12)+e1(16),e1(12);
0,0,0,0,0,0,0,0,0,0,0,0,e1(13)+e1(15)+e1(17)+e1(18),0,e1(13)+e1(17),0,e1(13)+e1(15),e1(13);
0,0,0,0,0,0,0,0,0,0,0,0,0,e1(14)+e1(15)+e1(16)+e1(18),e1(14)+e1(16),e1(14)+e1(15),0,e1(14);
0,0,0,0,0,0,0,0,0,0,0,0,0,0,e1(15)+e1(18),0,0,e1(15);
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,e1(16)+e1(18),0,e1(16);
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,e1(17)+e1(18),e1(17);
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,e1(18);
];
M=Transfer*e2;
M=M./sum(M);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -