I would like to generate random n-dimensional points with the same distance from the origin. i.e. norm(point) should be equal for all points... how can i achieve this?

 採用された回答

John D'Errico
John D'Errico 2012 年 6 月 2 日

0 投票

In n dimensions, to generate 1 such point...
X = randn(1,n);
X = X./norm(X);
To generate many such points, it is as easy a generating an array, then dividing each row by the norm of that row. sum and bsxfun will be of help here.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Random Number Generation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by