Institut de Robòtica i Informàtica Industrial

RandomGaussian

PURPOSE ^

Generates random points on a Gaussian.

SYNOPSIS ^

function R=RandomGaussian(G,n)

DESCRIPTION ^

 Generates random points on a Gaussian.

 Generates n random points following the given Gaussian distribution, G.

 Returns
   R: A column-wise set of randomly generated vectors.

CROSS-REFERENCE INFORMATION ^

This function calls:
  • size Number of poses in a trajectory.
  • size Size of the state estimated in the filter
  • size Size (rows/columns) of an interval matrix.
  • size Number of parameters of the pose.
  • size Number of readings stored in the Sensor.
This function is called by:

SOURCE CODE ^

0001 function R=RandomGaussian(G,n) 
0002 % Generates random points on a Gaussian.
0003 %
0004 % Generates n random points following the given Gaussian distribution, G.
0005 %
0006 % Returns
0007 %   R: A column-wise set of randomly generated vectors.
0008 
0009   if G.d==0
0010     R(:,1:n)=repmat(G.m,1,n);
0011   else
0012     L=chol(G.S);
0013     A_temp=normrnd(0,1,G.dim,n);
0014     A=L*A_temp;
0015     for i=1:size(A,2)
0016       R(:,i)=G.m+A(:,i);
0017     end
0018   end
0019


Institut de Robòtica i Informàtica Industrial

Generated on Fri 24-Jul-2009 12:32:50 by m2html © 2003