## Matlab

Moderators: None (Apply to moderate this forum)
Number of threads: 1471
Number of posts: 2147

This Forum Only

polynomial in matlab Posted by muboote on 27 Jan 2010 at 1:08 PM
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.
thanks for your repply.
Re: polynomial in matlab Posted by jjasso5 on 1 Feb 2010 at 4:11 PM
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â€¦

I suggest you visit this site:
matrixlab-examples.com/polynomials.html

Good luck!
Re: polynomial in matlab Posted by muboote on 2 Feb 2010 at 2:21 AM
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
Re: polynomial in matlab Posted by muboote on 2 Feb 2010 at 2:24 AM
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

## Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic