I have the matrix m
:
m={
{47, 17, 23},
{14, 24, 36},
{47, 31, 23}
}
I want to change the elements on its diagonal to {100,200,300}
.
The solution I have for that now is
Table[m〚i,i〛= {100,200,300}〚i〛
, {i, 1, Length[m]}]
I am sure there is a nicer way to do that, but I can't think of any.
Can anyone give me a hint?