Generate N random uniformly distributed points in the d-ball
    13 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
How to generate N random uniformly distributed points in the d - ball
0 commentaires
Réponses (2)
  Bruno Luong
      
      
 le 10 Jan 2019
        
      Modifié(e) : Bruno Luong
      
      
 le 10 Jan 2019
  
      d = 3
n = 10000;
% s is (d x n), n points in unit d-ball
s = randn(d,n);
r = rand(1,n).^(1/d);
c = r./sqrt(sum(s.^2,1));
s = bsxfun(@times, s, c);
0 commentaires
  Moreno, M.
 le 20 Mar 2022
        https://uk.mathworks.com/matlabcentral/fileexchange/108374-uniformly-distributed-points
0 commentaires
Voir également
Catégories
				En savoir plus sur Random Number Generation dans Help Center et File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


