两向量之间的匹配

两向量之间的匹配

在做雷达仿真中,用算法估计出的目标参数一般都会有误差,而且顺序不一定是与原来设定的源目标参数一定。若我们需要计算RMSE等参数去评估算法性能,此时匹配结果与目标参数向量是必要的

function [k1,k2] = Pair(k1,k2,s1,s2)
%s1, s2 are source data vector , k1,k2 are data vector to be in pair with...
% source data.
% we apply listing all combination , and compare which one is best.
S = length(s1);
% reshape all vector to column vector
s1 = reshape(s1,S,1);
s2 = reshape(s2,S,1);
% firstly match k1 and s1
P1 = perms(k1); % list all permutations of k1's elements
a = size(P1,1);
Za = zeros(a,1);
for ii = 1:a
    Za(ii)=norm(P1(ii,:)'-s1);% compute the minimize distance in two vector
end
nmi = find(Za == min(Za));
k1  = unique(P1(nmi,:),'rows'); % because nmi may be more than one

% then match k2 and s2
P2 = perms(k2); % list all permutations of k2's elements
b = size(P2,1);
Zb = zeros(b,1);
for ii = 1:b
    Zb(ii)=norm(P2(ii,:)'-s2);
end
nmi = find(Zb == min(Zb));
k2  = unique(P2(nmi,:),'rows');
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值