Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Creating array with specific sum
Date: Fri, 22 Jul 2011 11:16:11 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 17
Message-ID: <j0bm5q$t2$1@newscl01ah.mathworks.com>
References: <j0bgc5$g05$1@newscl01ah.mathworks.com> <j0blml$d45$1@news.albasani.net>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1311333371 930 172.30.248.48 (22 Jul 2011 11:16:11 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 22 Jul 2011 11:16:11 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2958486
Xref: news.mathworks.com comp.soft-sys.matlab:737156

Lothar Schmidt <vapooroop@gmx.net> wrote in message <j0blml$d45$1@news.albasani.net>...
> Am 22.07.2011 11:37, schrieb Mohd:
> > Hi,
> >
> > I want to create a 1xn array, that come out with specific total. For
> > example, given the summation of array is 20. Then, I want to create an
> > array with 1x5 matrix. The answer might be as follow:
> > [5 7 3 2 3], or [2 4 1 7 6] or any other 1x5 matrix with total 20.
> >
> > Thank you.
> 
> do you expect a special kind of distribution?
> are negativ values allowed

No, just to create +ve random integer

Thanks