#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# polynomial in matlab

Posts: 3Member
Hello,
am trying to use polynomial division in malab using deconvolution :

[res,rem]=deconv(a,b) my question is : is there a maximum degree of polynomial that this function accept? because it gives me a false result when using it.
the coeficient of the two polynomial are only 0's and 1's.
· ·

• Posts: 41Member
Matlab can do it with the command deconv, giving you the quotient and the remainder (as in synthetic division). For example:

% a = 2x^3 + 2x^2 - 2x - 2
% b = 2x - 2
a = [2 2 -2 -2];
b = [2 -2];

% now divide b into a finding the quotient and remainder
[q, r] = deconv(a,b)

You find quotient q = [1 2 1] (q = x2 + 2x + 1), and remainder r = [0 0 0 0] (r = 0), meaning that the division is exact, as expected from the example in the multiplication section
· ·
• Posts: 3Member
thanks for the repply
you're right but this is true somehow only for small degree or small power polynomial but if you try it with a large power polynomial it will gives some false error and when i say large i mean something bigger than x^32 in the nominator and x^32 in the denominator ofcource the polynomial don't contain only this. for matlab the results that it gives seems to be correct as if u do a check using the conv it will say that what it gived is ok, but when u look at the result there is some strange numbers that pop up on the coeficient of the remainder and the result as well large positive and negativ numbers which can't be true cause the coeficiet that i use are only 0's and 1's
may be you have an other idea?
thanks
· ·
• Posts: 3Member
thanks for the repply
you're right but this is true somehow only for small degree or small power polynomial but if you try it with a large power polynomial it will gives some false error and when i say large i mean something bigger than x^32 in the nominator and x^32 in the denominator ofcource the polynomial don't contain only this. for matlab the results that it gives seems to be correct as if u do a check using the conv it will say that what it gived is ok, but when u look at the result there is some strange numbers that pop up on the coeficient of the remainder and the result as well large positive and negativ numbers which can't be true cause the coeficiet that i use are only 0's and 1's
may be you have an other idea?
thanks
· ·