particle_choose.m

来自「该系统主要使用matlab实现了stbc2*1系统的发送和接收」· M 代码 · 共 25 行

M
25
字号
function [xhat]=particle_choose(xP,wP)
%This routine is used to choose the 
%xP particles
%wP weight
%Mn optional string to get mean
%Vnc optional string to get variance
global nTx nRx Npart

method = 'expected';

wP = wP/sum(wP);
xhat = zeros(nRx,nTx);
switch method
    case 'weighted'
        %Take particle with largest weight
        [Y,I]= max(wP);
        xhat = xP(:,:,I);
       
    case 'expected',
        for p = 1:Npart,
            xhat = xhat + wP(p)*xP(:,:,p);
        end
        
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?