![]() |
RandomGaussianPURPOSE
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:
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 |