From: amit sharma on 4 Jun 2010 12:56 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 4 Jun 2010 22:39 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 5 Jun 2010 12:28 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
|
Pages: 1 Prev: very short question array manipulation Next: Issue saving figures to file. |