Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: matrix generation
Date: Sun, 8 Nov 2009 17:53:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 15
Message-ID: <hd70ht$r9f$1@fred.mathworks.com>
References: <hd6uef$j43$1@fred.mathworks.com> <hd6utr$jgr$2@news.eternal-september.org>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257702781 27951 172.30.248.38 (8 Nov 2009 17:53:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 8 Nov 2009 17:53:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2017533
Xref: news.mathworks.com comp.soft-sys.matlab:583376


dpb <none@non.net> wrote in message <hd6utr$jgr$2@news.eternal-september.org>...
> jack j wrote:
> > Hi, I want to generate a 6x4 matrix of positive integers(max
> > value:50) such that the difference between the 3rd element and 1st
> > element in each row is 2 and difference of 2nd and 4th row element in
> > all rows is 3. Any help?
> 
> Generate (say) first and second columns then add 2 and 3, respectively. 
>     You can ensure the condition by either rejecting greater>50 values 
> and regenerating that pair or restrict the original rng range to <48 so 
> sum can exceed 50.
> 
> --

Did u mean a random number generation in a 'for' loop or a 6x2 random matrix generation and then a concatenation?