Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Generate random numbers with fixed sum and one value constraint
Date: Mon, 2 Apr 2012 22:05:12 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <jld7qo$r3o$1@newscl01ah.mathworks.com>
References: <jld06v$ol0$1@newscl01ah.mathworks.com> <ab4a0836-6a10-4661-9730-22a513bf4c97@z38g2000vbu.googlegroups.com> <a3741aa4-8fea-467a-9781-cd5e41dacad8@z5g2000yqj.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-06-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1333404312 27768 172.30.248.38 (2 Apr 2012 22:05:12 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 2 Apr 2012 22:05:12 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 3172787
Xref: news.mathworks.com comp.soft-sys.matlab:763085

Actually I need that >0.6 value as first element, but thanks for your interest :)
ImageAnalyst <imageanalyst@mailinator.com> wrote in message <a3741aa4-8fea-467a-9781-cd5e41dacad8@z5g2000yqj.googlegroups.com>...
> On Apr 2, 5:36 pm, "Dan " <scislowski.dan...@gmail.com> wrote:
> > Exactly what I need. Thank you.
> ------------------------------------------------------------
> Dan, if you want to make sure that the >0.6 value does not always
> occur at the first element, then add this code to Greg's code:
> 
> randomIndices = randperm(length(x))
> x = x(randomIndices)
> 
> That will locate the >0.6 number at a random location.