From: Walter Roberson <>
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$>
References: <ibu6dc$elk$> <ibui0l$50m$> <ibup5c$hmr$>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: 1289939189 3120 (16 Nov 2010 20:26:29 GMT)
NNTP-Posting-Date: Tue, 16 Nov 2010 20:26:29 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20101027 Thunderbird/3.0.10
In-Reply-To: <ibup5c$hmr$>
Xref: 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.