Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Interacting not only for the value but before for the dimensions

The following code, which is the answer to the question https://ask.sagemath.org/question/30156/how-to-use-matrices-with-interact/ is nice

@interact
def _(m = input_grid(2,2, default = [[1,7],[3,4]], label='M=', to_value=matrix)):
    print(m)
    print(m.eigenvalues())

But I wonder if it could be possible to modify it to cope with arbitrary dimension (First you must say what are the dimension of the grid. And secondly suppose that what interest you is a multiplication, how to enter 2 or tree matrices in the same way before realize the operation.