From: amit sharma on
Dear sir

I want to make a adjacent symmetric matrix(10x10), which each row and
column have five 1's random place.

Waiting for your kind response

thanks
From: Roger Stafford on
amit sharma <sharma.a28(a)gmail.com> wrote in message <f5874816-0954-45ed-9792-95990b58621f(a)42g2000prb.googlegroups.com>...
> I want to make a adjacent symmetric matrix(10x10), which each row and
> column have five 1's random place.

Hmm! Where have I seen that question before?

n = 10;
A = (1+(-1).^(0:n-1))/2;
A = toeplitz(A,A);
p = randperm(n);
A = A(p,p)

Roger Stafford
From: amit sharma on
On Jun 5, 6:39 am, "Roger Stafford"
<ellieandrogerxy...(a)mindspring.com.invalid> wrote:
> amitsharma<sharma....(a)gmail.com> wrote in message <f5874816-0954-45ed-9792-95990b586...(a)42g2000prb.googlegroups.com>...
> > I want to make a adjacent symmetric matrix(10x10), which each row and
> > column have five 1's random place.
>
>   Hmm!  Where have I seen that question before?
>
>  n = 10;
>  A = (1+(-1).^(0:n-1))/2;
>  A = toeplitz(A,A);
>  p = randperm(n);
>  A = A(p,p)
>
> Roger Stafford

thanks sir