Question: How to do something similar to subsop(index=value, List) for a Matrix?

Suppose we have the following simple Matrix

T := <1,2;3,4>;

How do we replace an entry with another expression?

I know that for a list L := [1,2,3] we can do, for example subsop(2=500,L) to replace the entry at index 2.

This creates a new list since lists are immutable.

As far as I can tell, a Matrix is mutable.

However, I wish to change an entry in a Matrix without mutating it.

My actual use case is the following.

I use LinearAlgebra:-Eigenvectors to obtain a Matrix of eigenvectors. Some of the entries are huge expressions with many variables. I would like to sub in placeholders where these huge expressions are so I can visualize the Matrix better, but without modifying the original Matrix.

Please Wait...