plotPURPOSEDisplays a particle-based belief.
SYNOPSISfunction h=plot(pb,varargin)
DESCRIPTIONDisplays a particle-based belief. Plots a particle set. Currently this function only works for particles defined on one-dimensional state spaces. When applied to other spaces it triggers an error. CROSS-REFERENCE INFORMATIONThis function calls:
SOURCE CODE0001 function h=plot(pb,varargin) 0002 % Displays a particle-based belief. 0003 % 0004 % Plots a particle set. 0005 % Currently this function only works for particles defined on one-dimensional 0006 % state spaces. When applied to other spaces it triggers an error. 0007 0008 if size(pb.samples,1)>1 0009 error('Plot of multidimensional samples is not implemented'); 0010 else 0011 n=size(pb.samples,2); 0012 X=zeros(1,3*n); 0013 Y=zeros(1,3*n); 0014 0015 r=3*(1:n); 0016 X(r)=pb.samples; 0017 %Y(r)=0; 0018 0019 r=r-1; 0020 X(r)=pb.samples; 0021 Y(r)=pb.w; 0022 0023 r=r-1; 0024 X(r)=pb.samples; 0025 %Y(r)=0: 0026 0027 h=line(X,Y); 0028 0029 if nargin>1 0030 set(h,varargin{1:end}); 0031 end 0032 end |