%particle filter % S is the set of Particles=[xj,wj:j=1..M] clear all; close all; k=0; data; [Estimate_bestparticle(:,k+1),Estimate_weightedmean(:,k+1),Estimate_robustmean(:,k+1)]=estimate(S); plot_particles(S,[xm(k+1),ym(k+1),thetam(k+1)],range_pos,Estimate_bestparticle(:,k+1),Estimate_weightedmean(:,k+1),Estimate_robustmean(:,k+1),parameter); mov(k+1)=getframe; W=S(4,:); % matrix of weights M=length(W); % M is the number of particles while k