How to handle symbolic polynomials?
1 回表示 (過去 30 日間)
古いコメントを表示
Hi, im looking for a way to create a function that takes an integer (k) and a simple but large symbolic polynomial like this :
1+x²+x³+x⁴.......
and returns only the part of the polynomial with a degree lower or equal to the integer k, can this be done?
for example
p= (syms) 1+x²+x³+x⁴+x⁶+x⁹
return=function(p,5)
return= (syms) 1+x²+x³+x⁴
0 件のコメント
採用された回答
Walter Roberson
2016 年 11 月 8 日
sym2poly(), take the last k+1 entries, poly2sym()
Or use coeffs('all') with two outputs, and take the last k+1 entries of the two outputs, dot product the two (that is, sum of the element-wise multiplications)
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!