

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. Symbolic Math Toolbox provides a set of functions for solving, plotting, and manipulating symbolic math equations.
#Matlab symbolic toolbox root finder code
The sample code is as follows with N 2 rng(0) Unknowns syms k1 k2. When you solve a polynomial equation, the solver might use root to return the. use symbolic math toolbox to build the polynomials Then use solve() to find the roots. Symbolic Math Toolbox is available (or included with the Student Version), which. The equations are charA = det(*Amatrix - eye(2*N)) ĬharB = det(*Bmatrix - eye(2*N)) Īnd 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). Instead, use syms to declare variables and replace inputs such as. Finding analytical solutions of differential equations (if possible). MATLAB is finding a complex cube root of 1, while we would expect a real root.


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). Toolbox which allows MATLAB to perform symbolic calculations as well as. 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).
