Suppose M is an matrix and we want to multiply each row by a coefficient. The coefficients are stored in a vector coeff with n components. In that case, automatic reshaping will not work, and we have to execute:
rescaled = M*coeff.reshape(-1,1)
Suppose M is an matrix and we want to multiply each row by a coefficient. The coefficients are stored in a vector coeff with n components. In that case, automatic reshaping will not work, and we have to execute:
rescaled = M*coeff.reshape(-1,1)