A more efficient way to construct a coefficient array?

3 vues (au cours des 30 derniers jours)
Jonah Berean-Dutcher
Jonah Berean-Dutcher le 7 Avr 2021
This is a follow-up to an older question: Using coeffs to extract a matrix. The answer there is great, but I'm just wondering if there is a more efficient way of performing this operation:
I have a polynomial function of many symbolic variables, and I want to extract the 'coefficient matrix' from this polynomial. Every term in the polynomial has only two factors of these symbolic variables, i.e.
The coefficient matrix I want to extract is the one that would produce precisely this polynomial if I evaluated the vector-matrix-vector product:
where here x is a vector whose entries are all these symbolic variables, and K is the coeffient matrix.
I have found that using hessian() to do this has been very slow as the polynomial expression becomes large. Is this the best method available in MATLAB?

Réponses (0)

Catégories

En savoir plus sur Polynomials dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by