d-s证据理论 matlab代码2
生活随笔
收集整理的這篇文章主要介紹了
d-s证据理论 matlab代码2
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
代碼說明:
matlab7.1環境,把當前文件夾指定為matlab工作目錄
simulate.m為主控程序
其余為被調函數
文件1 ds_fusion.m
function x=DS_fusion(x,y)%功能:融合x,y兩行向量[nx,mx]=size(x); if 1~=nxdisp('x應為行向量');return; end[ny,my]=size(y); if 1~=nydisp('y應為行向量');return; endif mx~=mydisp('x,y列數應相等');return; endtemp=0; for i=1:mx-1x(1,i)=x(1,i)*y(1,i)+x(1,i)*y(1,mx-1)+y(1,i)*x(1,mx-1);if i==mx-1x(1,i)=x(1,i)*y(1,i);endtemp=temp+x(1,i); endfor i=1:mx-1x(1,i)=x(1,i)/temp; endx(1,mx)=0;文件2 ds_out.m
function DS_out(Result,ec1,ec2)%功能:由Result結果和ec1 ec2做出判斷 [nx,mx]=size(Result); if 1~=nxdisp('Result應為行向量');return; end[data,index]=sort(Result(1,1:mx-2)); %升序排列if (Result(index(mx-2))-Result(index(mx-3))>ec1) & (Result(mx-1)<ec2) & (Result(index(mx-2))>Result(mx-1))if index(mx-2)==1 %火控 瞄準 導航 預警Type='機載火控雷達';elseif index(mx-2)==2 Type='機載瞄準雷達';elseif index(mx-2)==3 Type='機載導航雷達';elseif index(mx-2)==4 Type='機載預警雷達';elseType='識別算法出錯';end elseType='無法識別目標'; endType文件3 simulate.m
clear%%%%%%%%%% D_S算法設置 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%num_Sensor=3; %傳感器數目num_Object=6; %識別對象數目 四個目標(機載雷達: 火控 瞄準 導航 預警)+全集+空集num_Period=3; %測量周期數Info=zeros(num_Sensor,num_Object,num_Period); % 一次判決所需要的信息Info(:,:,1)=[0.30 0.40 0.15 0.00 0.15 0.00;0.30 0.50 0.10 0.00 0.10 0.00;0.30 0.30 0.20 0.00 0.20 0.00;];Info(:,:,2)=[0.40 0.20 0.20 0.00 0.20 0.00;0.50 0.20 0.20 0.00 0.10 0.00;0.50 0.30 0.10 0.00 0.10 0.00;];Info(:,:,3)=[0.50 0.20 0.15 0.00 0.15 0.00;0.40 0.30 0.10 0.00 0.20 0.00;0.40 0.20 0.10 0.00 0.30 0.00;]; Info1=zeros(num_Period,num_Object);%各周期內傳感器的融合for i=1:num_PeriodInfo1(i,:)=Info(1,:,i);for j=1:num_Sensor-1Info1(i,:)=DS_fusion(Info1(i,:),Info(j+1,:,i));endend%周期之間的融合Result=Info1(1,:);for i=1:num_Period-1Result=DS_fusion(Result,Info1(i+1,:));endec1=0.1; %融合決策判據ec2=0.1;DS_out(Result,ec1,ec2);總結
以上是生活随笔為你收集整理的d-s证据理论 matlab代码2的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: STM32之UART、RS232、RS4
- 下一篇: 基于Token实现开放API接口签名验证