Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: to make adjacent matrix
Date: Wed, 12 May 2010 06:33:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 33
Message-ID: <hsdi30$qnu$1@fred.mathworks.com>
References: <7e14b2c2-8016-4254-9a69-aec4777e8b5d@r21g2000prr.googlegroups.com> <hsdgpo$8aq$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1273645984 27390 172.30.248.37 (12 May 2010 06:33:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 12 May 2010 06:33:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:634921

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <hsdgpo$8aq$1@fred.mathworks.com>...
> amit sharma <sharma.a28@gmail.com> wrote in message <7e14b2c2-8016-4254-9a69-aec4777e8b5d@r21g2000prr.googlegroups.com>...
> > dear sir
> > I want to make 10X10 adjacent matrix in which every row and colom have
> > 5  one's .
> > Matrix should be symmetric.
> > waiting for ur response
> 
>   How about a chess board arrangement except that it is 10 x 10?  The black squares are the 1's and the white squares are the 0's.
> 
>  M = [1 0 1 0 1 0 1 0 1 0;
>       0 1 0 1 0 1 0 1 0 1;
>       1 0 1 0 1 0 1 0 1 0;
>       0 1 0 1 0 1 0 1 0 1;
>       1 0 1 0 1 0 1 0 1 0;
>       0 1 0 1 0 1 0 1 0 1;
>       1 0 1 0 1 0 1 0 1 0;
>       0 1 0 1 0 1 0 1 0 1;
>       1 0 1 0 1 0 1 0 1 0;
>       0 1 0 1 0 1 0 1 0 1];
> 
> You can generate this with a toeplitz function.
>  
> Roger Stafford

  Or how about any permutation made on both the columns and rows of M:

 p = randperm(10);
 M2 = M(p,p);

That would give you a large variety to choose from.

Roger Stafford