From: ImageAnalyst <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to generate vector of random numbers in any interval (e.g.
 [-1 1]) that sums to 1)
Date: Tue, 9 Nov 2010 05:06:27 -0800 (PST)
Lines: 16
Message-ID: <>
References: <ibbfkv$l6m$>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: 1289307987 17021 (9 Nov 2010 13:06:27 GMT)
NNTP-Posting-Date: Tue, 9 Nov 2010 13:06:27 +0000 (UTC)
Injection-Info:; posting-host=; posting-account=0rLUzAkAAABojYSRC64DkTbtiSCX77HH
User-Agent: G2/1.0
X-HTTP-Via: 1.1 bdci2px (NetCache NetApp/6.0.7)
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:
 Gecko/20101026 Firefox/3.6.12,gzip(gfe)
Xref: comp.soft-sys.matlab:685100

On Nov 9, 7:43 am, "Vassilios Vassiliadis"
<> wrote:
> Hello,
> I'd like to generate a vector of random numbers,which take values in any interval (e.g. [-1 1]),and this vector sums to 1...
> Thanx in advance...
> Vassilis...

I'm not sure that's possible.  Can you tell me how you could take a
bunch of numbers in the interval [-100 -50] and have that sum to
1????  If you made the sum equal to 1, you'd no longer have values in
the range -100 to -50 - you'd have to change the range (the values of
the numbers).  I don't think you can have it both ways: both in the
range and with the prescribed sum.