Set seed before generating random matrix