power of polynomial (without symbolic calculation)
11 ビュー (過去 30 日間)
古いコメントを表示
Hello, Is there away to get nth power of polynomial without using symbolic calculation? For example f(x)=x^2+1 and I want g(x)=(x^2+1)^3 => x^6 + 3*x^4 + 3*x^2 + 1
so without symbolic variables => f=[2 1] => g=[1 0 3 3 0 1]
Thanks
Kamuran
0 件のコメント
採用された回答
Star Strider
2015 年 5 月 28 日
Your ‘g’ is incorrect.
This works:
pn = [1 0 1]; % Polynomial
res = 1; % Result Variable
pwr = 3; % Power
for k1 = 1:pwr
res = conv(res, pn);
end
Result = res
その他の回答 (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!