Institut de Robòtica i Informàtica Industrial

plot

PURPOSE ^

Plots a Gaussian.

SYNOPSIS ^

function h=plot(g,varargin)

DESCRIPTION ^

  Plots a Gaussian.

  Plots a Gaussian. For one-dimensinal Gaussians produces a
  one-dimensional plot. For higher dimensional Gaussians an ellipse
  representing the marginal of the Gaussian on the two first dimensions is
  shown.
  The fuction accepts an optional parameter with the color for the plot.

  Returns:
    h: The handler of the line/ellipse representing the Gaussian.

CROSS-REFERENCE INFORMATION ^

This function calls:
  • plot Plots a discrete belief.
  • get Get for GBeliefs.
  • plot Displays a particle-based belief.
  • Value Evaluates a GMixture.
  • get Get function for the GMixture object.
  • plot Plots a Gaussian mixture.
  • set Set method for Gaussian mixtures.
  • Value Evaluation of a Gaussian.
  • get Gaussian object get function.
  • plot Plots a Gaussian.
  • plot Plots the CS_CO_ObsModel
  • 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)
  • plot Plots the CS_CA_RewardModel
This function is called by:

SOURCE CODE ^

0001 function h=plot(g,varargin)
0002 %  Plots a Gaussian.
0003 %
0004 %  Plots a Gaussian. For one-dimensinal Gaussians produces a
0005 %  one-dimensional plot. For higher dimensional Gaussians an ellipse
0006 %  representing the marginal of the Gaussian on the two first dimensions is
0007 %  shown.
0008 %  The fuction accepts an optional parameter with the color for the plot.
0009 %
0010 %  Returns:
0011 %    h: The handler of the line/ellipse representing the Gaussian.
0012 
0013   if g.d==0
0014         h=0;
0015     else
0016         if g.dim==1
0017               r=3*sqrt(g.S); % represent the Gaussian from -3*sigma to 3*sigma
0018                 n=100; %points of the curbe representing the gaussain
0019       
0020                 X=(-r:(2*r)/(n-1):r)+g.m;
0021                 Y=Value(g,X);
0022   
0023                 plot(X,Y);
0024         else
0025             h=line([g.m(1) g.m(1)],[g.m(2) g.m(2)]);
0026             set(h, 'marker','*');
0027             if nargin>1
0028                 set(h, 'Color',varargin{1});
0029             end
0030             el=get(g,'ellipse');
0031             h = line(el(1,:),el(2,:));
0032 
0033             if nargin>1
0034                 set(h, 'Color',varargin{1});
0035             end
0036         end
0037     end


Institut de Robòtica i Informàtica Industrial

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