Generate N random uniformly distributed points in the d-ball
조회 수: 8 (최근 30일)
이전 댓글 표시
How to generate N random uniformly distributed points in the d - ball
댓글 수: 0
답변 (2개)
Bruno Luong
2019년 1월 10일
편집: Bruno Luong
2019년 1월 10일
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
Moreno, M.
2022년 3월 20일
https://uk.mathworks.com/matlabcentral/fileexchange/108374-uniformly-distributed-points
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Random Number Generation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!