"Roger Stafford" wrote in message <firstname.lastname@example.org>... > "Greg Heath" <email@example.com> wrote in message <firstname.lastname@example.org>... > > "Dmitrey Yershov" <email@example.com> wrote in message <firstname.lastname@example.org>... > > > Hello. I need to generate non-negative rundom numbers sum of which is equal to 1. Each number xi is constrained: ai<=xi<=bi. How can I do this? Similar question was solved here > > > > > > http://www.mathworks.com/matlabcentral/fileexchange/9700 > > > > > > but in this alghorithm a<=xi<=b (a and b are the same for all xi). Any ideas? > > > > Z = a + (b-a)*rand(m,n); > > > > sumZ = repmat(sum(Z),m,1); > > > > I'll let you figure out the rest. > > > > Hope this helps > > > > Greg > - - - - - - - - - - > I'd like to know the answer to that too, Greg. Suppose your m = 3, n = 1, a = 0, and b = 2/3, and suppose z comes up randomly with z = [.6;.1;.1] as is possible. How is that point supposed to be projected onto a plane so as to have a sum of 1? A simple division by its sum(z) = .8 gives [.75;.125;.125] which exceeds the stated limit.
WHOOPS! Silly mistake.
Please pardon my youthful exuberance.
P.S. The OP did not indicate that the number of points is specified. Was that an unintended omission?