Using matlab, how to generate 3 ^ 10 digit net which is evenly located on 8-dimensional (Or distributed) Unit Sphere?
From Wikipedia
To generate evenly distributed random numbers For (N-1) -saphere (i.e., the surface of N-ball), MarsGlia (1972) gives the following algorithms.
Generate an en-dimensional vector of normal deviation (it is adequate to use N (0, 1), although in reality the choice of variance is arbitrary), \ mathbf {x} = (x_1 , X_2, \ ldots, x_n).
Now, "radius" of this point, r = \ sqrt {x_1 ^ 2 + x_2 ^ 2 + \ cdots + x_n ^ 2}
vector \ frac {1} {r} \ mathbf {x} is evenly distributed on the surface of the unit n-ball.
This is a matlab code piece to complete:
numdims = 8; Numbers = 3 ^ 10; X = randn ([numdims numpts]); Lax = Repat (SQLT (amount (x ^ 2,1)), [number1]); X = X. / Lx; % X (:, j) is the point at the circle)
Comments
Post a Comment