A more efficient way to construct a coefficient array?
3 ビュー (過去 30 日間)
古いコメントを表示
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/576507/image.png)
The coefficient matrix I want to extract is the one that would produce precisely this polynomial if I evaluated the vector-matrix-vector product:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/576512/image.png)
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?
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Polynomials についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!