Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!y27g2000yqy.googlegroups.com!not-for-mail
From: ImageAnalyst <imageanalyst@mailinator.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: random number
Date: Sat, 17 Mar 2012 08:59:23 -0700 (PDT)
Organization: http://groups.google.com
Lines: 13
Message-ID: <3ffd8eee-f498-46ab-b503-c29702e0c45d@y27g2000yqy.googlegroups.com>
References: <jk22uj$p9e$1@newscl01ah.mathworks.com> <jk278p$d42$1@speranza.aioe.org>
NNTP-Posting-Host: 184.57.134.178
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: posting.google.com 1332000056 7292 127.0.0.1 (17 Mar 2012 16:00:56 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sat, 17 Mar 2012 16:00:56 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: y27g2000yqy.googlegroups.com; posting-host=184.57.134.178; posting-account=0rLUzAkAAABojYSRC64DkTbtiSCX77HH
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2)
 Gecko/20100101 Firefox/10.0.2,gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:761308

Or you can have them uniformly distributed like

% Set up parameters:
center = 3;
range = 2;
numberOfNumbers = 100;

% Now get the array.
numbers = center + range * rand(1, numberOfNumbers) - range/2

% Let's check where they fall to see if we did it correctly:
minValue = min(numbers)
maxValue = max(numbers)