필터 지우기
필터 지우기

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

조회 수: 2 (최근 30일)
A P S
A P S 2014년 11월 29일
댓글: Roger Stafford 2014년 11월 29일
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
Roger Stafford
Roger Stafford 2014년 11월 29일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Roger Stafford
Roger Stafford 2014년 11월 29일
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.

카테고리

Help CenterFile 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