Generate N random uniformly distributed points in the d-ball

조회 수: 8 (최근 30일)
christina
christina 2019년 1월 10일
답변: Moreno, M. 2022년 3월 20일
How to generate N random uniformly distributed points in the d - ball

답변 (2개)

Bruno Luong
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);

Moreno, M.
Moreno, M. 2022년 3월 20일
https://uk.mathworks.com/matlabcentral/fileexchange/108374-uniformly-distributed-points

카테고리

Help CenterFile Exchange에서 Random Number Generation에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by