I want to generate some M number of vectors of length N with the entries restricted to -1s and 1s and the vectors should not be repetitive. Is it possible to do so? If yes, how?

# MATLAB: Generating vectors of length N with only -1s and 1s.

randomvectors

###### Related Question

- Counting consecutive occurences of 1s and -1s
- How to convert a 64 bit, two’s complement value(binary vector)[ 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] into a signed integer
- How do i generate a random set of numbers of -1s and 1s without getting any 0s
- Matrix[1,1,1,1;-1,-1,-1,-1;1,1,1,1] to vector[1,1,1,1,-1,-1,-1,-1,1,1,1,1]

## Best Answer