필터 지우기
필터 지우기

power of polynomial (without symbolic calculation)

조회 수: 2 (최근 30일)
Kamuran
Kamuran 2015년 5월 28일
댓글: Star Strider 2015년 5월 28일
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

채택된 답변

Star Strider
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 CenterFile Exchange에서 Polynomials에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by