function [estimate_bestparticle,estimate_weightedmean,estimate_robustmean]=estimate(S) M=length(S(4,:)); %estimate % the best particle [maximum,index]=max(S(4,:)); estimate_bestparticle=S(:,index); %weighted mean sum_weightedmean=0; %robus mean sum_particles=0; sum_weights=0; delta_pos=0.5; delta_ang=10*pi/180; count=0; for j=1:M %weighted mean sum_weightedmean=sum_weightedmean+S(:,j)*S(4,j); %robus mean if sqrt((estimate_bestparticle(1)-S(1,j))^2+(estimate_bestparticle(2)-S(2,j))^2)