Working With Reciprocal of Polynomials

12 次查看(过去 30 天)
Hello, this is my first post in this form and I am new to MatLab. I would like to take the reciprocal of a polynomial in factored form and express the answer in polynomial form. For example, I wish to convert 10/((x+3)^2(x+5)) in regular polynomial form.
  4 个评论
Daniel Scrobe
Daniel Scrobe 2024-8-25
I think maybe I am asking Matlab to perform something that can’t be done. I want to divide a number by an expression that is in factored form and assign the answer to a variable. I thought using the poly command provides the coefficients of a polynomial and also is the expression itself. But results of the poly command simply outputs an array of numbers. I just may be going about this in the wrong way.
Torsten
Torsten 2024-8-25
编辑:Torsten 2024-8-25
syms x
p = (x+3)^2*(x+5)
p = 
expand(p)
ans = 
coeffs(p)
ans = 
What do you want to do next ?

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2024-8-25
移动:Sam Chak 2024-8-26
It is difficult to tell what you want?
syms x
f = 10/((x+3).^2.*(x+5))
f = 
[N, D] = numden(f)
N = 
10
D = 
C = coeffs(D, x)
C = 
poly2sym(C, x)
ans = 
tf(double(N), double(C))
ans = 10 -------------------------- 45 s^3 + 39 s^2 + 11 s + 1 Continuous-time transfer function.
  3 个评论
Sam Chak
Sam Chak 2024-8-26
Given that you found the suggested solution helpful and your problem has been resolved, please consider clicking "Accept" on the answer to close the issue. This helps provide closure and mark the question as answered for the benefit of the community.

请先登录,再进行评论。

更多回答(1 个)

Naga
Naga 2024-8-25
编辑:Walter Roberson 2024-8-25
Hello Daniel,
To convert a polynomial in factored form to regular polynomial form, you can use the poly function in MATLAB. Here's an example:
% Define the factored polynomial
num = 10;
den = conv(conv([1 3], [1 3]), [1 5]);
% Convert to regular polynomial form
coeffs = num * poly(den)
coeffs = 1x5
10 -960 27740 -219840 193050
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
The 'poly' function converts the factored form to regular polynomial form, and then we multiply it by the numerator to get the coefficients of the regular polynomial. Please refer to the following documentation for more information on 'poly' function:
Hope this helps!
  3 个评论
Sam Chak
Sam Chak 2024-8-26
I'm a little confused. Are you referring to an inverse function or a reciprocal function? If reciprocal function, then the title of your question is misleading and please consider amending it.
Daniel Scrobe
Daniel Scrobe 2024-8-26
Sam,
Darn, I meant reciprocal not inverse. I changed the title. Got these mixed up. Sorry for confusion. I did learn a lot from everyone's answers. Thank you.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Number Theory 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by