generate_weights function

Generate a matrix containing weight combinations