Path: news.mathworks.com!newsfeed-00.mathworks.com!solaris.cc.vt.edu!news.vt.edu!news.glorb.com!news.cse.ohio-state.edu!pitt.edu!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: Walter Roberson <roberson@hushmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Generate random matrix with constraints
Date: Tue, 16 Nov 2010 14:26:28 -0600
Organization: Canada Eat The Cookie Foundation
Lines: 17
Message-ID: <ibupdl$31g$3@canopus.cc.umanitoba.ca>
References: <ibu6dc$elk$1@fred.mathworks.com> <ibui0l$50m$1@fred.mathworks.com> <ibup5c$hmr$1@fred.mathworks.com>
NNTP-Posting-Host: ibd-nat.ibd.nrc.ca
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: canopus.cc.umanitoba.ca 1289939189 3120 132.246.133.10 (16 Nov 2010 20:26:29 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Tue, 16 Nov 2010 20:26:29 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.15) Gecko/20101027 Thunderbird/3.0.10
In-Reply-To: <ibup5c$hmr$1@fred.mathworks.com>
Xref: news.mathworks.com comp.soft-sys.matlab:687395

On 10-11-16 02:22 PM, Ryan wrote:

> I should have asked the question better.
> In this matrix that I mentioned above, I need each element varies from
> -1 to 1. I don't care about what kind of distribution are these elements
> from. The only constraint here for each row is that they need to sum up
> to 1.
>
> What's the best way to structure that?

Make each row a copy of the vector [-1 -1 1 1 1]

As you do not care about the distribution, you do not care that the 
distribution is completely fixed rather than being random, and you do not care 
that only the extreme values are being used.

If you *do* care about those things, then you *do* care about the distribution.