From: amit sharma on 23 Apr 2010 15:48 Sir i want to make an array of [16*8] random number of [1,16] in which every column have non repeating number and row elements are not same.
From: John D'Errico on 23 Apr 2010 17:42 amit sharma <sharma.a28(a)gmail.com> wrote in message <9b0e17ed-08b7-4f2a-b108-85c55438de6a(a)x23g2000prd.googlegroups.com>... > Sir > > i want to make an array of [16*8] random number of [1,16] in which > every column have non repeating number and row elements are not same. Assuming that you intend to have each column of your array a permutation of the numbers 1:16, then simplest is just to use a random sample for the first column, then generate a new random sample for the second column. Reject if there are any conflicts, and repeat for each column, one at a time. This will get more difficult by the time you go out 8 columns. As I said, simple, but not very efficient. John
From: amit sharma on 25 Apr 2010 03:22 On Apr 24, 1:42 am, "John D'Errico" <woodch...(a)rochester.rr.com> wrote: > amit sharma <sharma....(a)gmail.com> wrote in message <9b0e17ed-08b7-4f2a-b108-85c55438d...(a)x23g2000prd.googlegroups.com>... > > Sir > > > i want to make an array of [16*8]randomnumberof [1,16] in which > > every column havenonrepeatingnumberand row elements are not same. > > Assuming that you intend to have each column of your > array a permutation of the numbers 1:16, then simplest > is just to use arandomsample for the first column, then > generate a newrandomsample for the second column. > Reject if there are any conflicts, andrepeatfor each > column, one at a time. This will get more difficult by > the time you go out 8 columns. > > As I said, simple, but not very efficient. > > John thank sir
|
Pages: 1 Prev: Matlab toolboxes for dvb-h Next: Plotting point color as a function of a third variable |