I want to generate random binary polynomials with parameters (n,m)
.
n is the number of polynomials to be generated and m is the number of elements of each polynomials.
At the same time I need it's polynomial to be unique. And I also need to exclude the result with all elements equal to zero.
For example for n=3
and m=3
I am looking for something like
[1 0 1] [1 0 0] [1 1 1]
.
Is there any command in mat lab which I can use to have the above results?? I would also like to avoid the for loop if possible!!
EDIT: I found that the command unique(rand(n,m)>=0.5,'rows')
will do the job. But this does not guarantee that the result [0 0 0]
will be excluded
any ideas?