def mulmatscaler(matlist, scaler, K):
 return [mulrowscaler(row, scaler, K) for row in matlist]

def mulmatscaler ( matlist , scaler , K ) : return [ mulrowscaler ( row , scaler , K ) for row in matlist ]
performs scaler matrix multiplication one row at at time .