Institut de Robòtica i Informàtica Industrial

plot

PURPOSE ^

Plots a Gaussian mixture.

SYNOPSIS ^

function h=plot(gm,varargin)

DESCRIPTION ^

   Plots a Gaussian mixture.

   This function only works for  Gaussian mixtures defined on 
   one-dimensional spaces.
   The function accepts all the parameters applicable to Matlab lines
   (linestyle, color, etc).

CROSS-REFERENCE INFORMATION ^

This function calls:
  • get Get for GBeliefs.
  • Value Evaluates a GMixture.
  • get Get function for the GMixture object.
  • set Set method for Gaussian mixtures.
  • Value Evaluation of a Gaussian.
  • get Gaussian object get function.
  • get Get function for CS_CO_CA_POMDPs.
  • get Get function for CS_CO_DA_POMDPs.
  • get Get function for CS_CO_POMDPs.
  • get Get function for CS_DO_CA_POMDPs.
  • get Get function for CS_DO_DA_POMDPs.
  • get Get function for CS_POMDPs.
  • get Get function for DS_CO_CA_POMDPs.
  • get Get function for DS_CO_DA_POMDPs.
  • get Get function for DS_DO_CA_POMDPs.
  • get Get function for DS_DO_DA_POMDPs.
  • get Get functio for POMDPs.
  • set Set function for PODMP (base type)
  • max Upper bound of a CSpace
  • min Lower bound of a CSpace
This function is called by:

SOURCE CODE ^

0001 function h=plot(gm,varargin)
0002 %   Plots a Gaussian mixture.
0003 %
0004 %   This function only works for  Gaussian mixtures defined on
0005 %   one-dimensional spaces.
0006 %   The function accepts all the parameters applicable to Matlab lines
0007 %   (linestyle, color, etc).
0008 
0009   if gm.n>0
0010     if get(gm.g{1},'dim')==1
0011       l=zeros(1,gm.n);
0012       u=zeros(1,gm.n);
0013       for i=1:gm.n
0014         c=sqrt(get(gm.g{i},'covariance'));
0015         m=get(gm.g{i},'mean');
0016         l(i)=m-3*c;
0017         u(i)=m+3*c;
0018       end
0019       mi=min(l);
0020       ma=max(u);
0021       
0022       n=100;
0023       X=mi:(ma-mi)/(n-1):ma;
0024       Y=Value(gm,X);
0025       h=line(X,Y);
0026             if nargin>1
0027                 set(h,varargin{1:end});
0028             end
0029     else
0030       error('Plot of multi-dimensional GMixtures is not implemented yet');
0031     end
0032   end


Institut de Robòtica i Informàtica Industrial

Generated on Wed 05-Aug-2009 15:05:21 by m2html © 2003