Replace diagonal of matrix with new diagonal values

This older post provides some approaches using direct indexing to fill the diagonal with a tensor.

1 Like