Filter löschen
Filter löschen

Generate Random Numbers such that Sum of their Squares is 1 ???

2 Ansichten (letzte 30 Tage)
A P S
A P S am 29 Nov. 2014
Kommentiert: Roger Stafford am 29 Nov. 2014
Hey all ,,
I would like to generate random numbers ( Normal Distribution) Such that their sum of Squares should be one .... Can any one suggest some idea
???/
  1 Kommentar
Roger Stafford
Roger Stafford am 29 Nov. 2014
This is an impossible request. Having a sum of squares be one requires that the numbers be bounded. Having a normal distribution requires that values are unbounded. You can't have both.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Roger Stafford
Roger Stafford am 29 Nov. 2014
If you drop any requirement of having a "normal" distribution, you can do this:
x = randn(n,1);
x = x/sqrt(sum(x.^2));
The sum of the squares of the n elements in x will always be 1.

Kategorien

Mehr zu Random Number Generation finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by