?? resample_particles.m
字號:
function particles= resample_particles(particles, Nmin, doresample)
%function particles= resample_particles(particles, Nmin, doresample)
%
% Resample particles if their weight variance is such that N-effective
% is less than Nmin.
%
N= length(particles);
w= zeros(1,N);
for i=1:N, w(i)= particles(i).w; end
ws= sum(w); w= w/ws;
for i=1:N, particles(i).w= particles(i).w / ws; end
[keep, Neff] = stratified_resample(w);
if Neff < Nmin & doresample==1
particles= particles(keep);
for i=1:N, particles(i).w= 1/N; end
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -