How to re-scale a matrix column and show the matrix in one line?
Why not use Dot
instead?
p . DiagonalMatrix[{1, 1, 5}]
{{a, b, 5 c}, {d, e, 5 f}, {g, h, 5 i}}
MapAt
q = MapAt[5 # &, p, {All, 3}]
{{a, b, 5 c}, {d, e, 5 f}, {g, h, 5 i}}
ReplacePart
q = ReplacePart[p, {i_, 3} :> 5 p[[i, 3]]]
{{a, b, 5 c}, {d, e, 5 f}, {g, h, 5 i}}
ScalingMatrix + Dot
q = p.ScalingMatrix[{1, 1, 5}]
{{a, b, 5 c}, {d, e, 5 f}, {g, h, 5 i}}
p // ScalingTransform[{1, 1, 5}]