I have a matrix M, whose each element is dependent on a single variable t in a different quadratic form without the constant.
Just for example,
M[1,1] = 2t^2 + 4t
M[3,2] = t^2 - 5t
M[2,4] = -t^2 + 5t
The matrix is acquired after a series of calculation and each element, or say, the coefficients before t^2 and t, are figured out through a combination of a bunch of other functions.
I was wondering how I can store the matrix like a function M(t) so each time I can call the function to generate a matrix with different t.
Thanks!
UPDATE: The purpose is to get the smallest eigenvalue of the matrix given different t, so I was thinking I could generate a matrix each time and feed it to a eigenvalue solver to get the smallest eigenvalue for each t.