modification of the output to make it conformable with the modification in resample.m
parent
920d2af8d3
commit
51c5363850
|
@ -1,4 +1,4 @@
|
||||||
function indx = residual_resampling(weights,noise)
|
function return_resample = residual_resampling(particles,weights,noise)
|
||||||
% Resamples particles.
|
% Resamples particles.
|
||||||
|
|
||||||
%@info:
|
%@info:
|
||||||
|
@ -105,6 +105,11 @@ for i=1:number_of_particles
|
||||||
k = k + iWEIGHTS(i);
|
k = k + iWEIGHTS(i);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if particles==0
|
||||||
|
return_resample = indx ;
|
||||||
|
else
|
||||||
|
return_resample = particles(indx,:) ;
|
||||||
|
end
|
||||||
%@test:1
|
%@test:1
|
||||||
%$ % Define the weights
|
%$ % Define the weights
|
||||||
%$ weights = randn(2000,1).^2;
|
%$ weights = randn(2000,1).^2;
|
||||||
|
|
Loading…
Reference in New Issue