hstack makes a copy of all these (rather large) matrices. There must be a smarter way of packing and unpacking parameters.