gusucode.com > ​多天线系统的各种信号检测算法matlab源码程序 > MIMO_detection/sort_optimal_index.m

    function [optimal_index]=sort_optimal_index(est,cand,N)

optimal_index=0;
min_err=99999999;
for n=1:N
    diff=est-cand(n);
    err=diff'*diff;
    if err<min_err
        min_err=err;
        optimal_index=n;
    end
end
return;