I need to be able to find the roots of a couple of polynomials that are almost characteristic functions, but not quite (rather than an eigenvalue, it's more like an eigen-block matrix). The function is defined as a function handle because I don't have analytic expressions for the coefficients on the equation (I could presumably find them but the algebra in my model is already quite messy).
The equations are
charA = @(k1,k2) det([k1*eye(N),zeros(N);zeros(N),k2*eye(N)]*Amatrix - eye(2*N));
charB = @(k1,k2) det([k1*eye(N),zeros(N);zeros(N),k2*eye(N)]*Bmatrix - eye(2*N));
and I need to find all of the roots of each one, since the solution of the system is the pair (k1,k2) that satisfies charA(k1,k2)=0 and charB(k1,k2)=0 (at the moment I'm just trusting that the derivations of these matrices are such that such a solution exists, but for the purpose of this question - finding all of the roots of a polynomial defined in this sort of way - this is unimportant).
Is there any way I can take this function handle and turn it into a matrix of coefficients, or is there a solver for polynomials defined as function handles in Matlab? If it changes anything, the matrices aren't massive but they are 84x84, that is, N=42.
roots()
orfzero()
? – SecretAgentManfminsearch()
. I see your concern. – SecretAgentMan