Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how to generate random variable with constraint?
Date: Tue, 20 Jul 2010 02:05:06 +0000 (UTC)
Organization: The Mitre Corp
Lines: 9
Message-ID: <i2308i$7p$1@fred.mathworks.com>
References: <i22vhv$frn$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1279591506 249 172.30.248.35 (20 Jul 2010 02:05:06 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 20 Jul 2010 02:05:06 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2318
Xref: news.mathworks.com comp.soft-sys.matlab:654432

"jay " <ssjzdl@gmail.com> wrote in message <i22vhv$frn$1@fred.mathworks.com>...
> I need to generate 5 random variables between [0,1], let's say a, b, c, d, e. The constraint is that a<b<c<d<e. How to make this happen? Please advise. thanks

doc rand
doc sort

It seems to me that the only way 5 random numbers wouldn't 
satisfy that constraint is if 2 or more of them are equal.  
A very unlikely event.