apply_nmar_scaling function

Apply scaling to a matrix using a recipe