Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.1.0 - Русский

Change language to:
English - Français - 日本語 - Português -

Please note that the recommended version of Scilab is 2023.1.0. This page might be outdated.
See the recommended documentation of this function

Справка Scilab >> Polynomials > pdiv


polynomial division


[R, Q] = pdiv(P1,P2)
Q = pdiv(P1,P2)


P1, R, Q

arrays of polynomials with real or complex coefficients, of same sizes. Q are Quotients and R are Remainders.

When all remainders R are constant (degree==0), R is of type 1 (numbers) instead of 2 (polynomials).


single polynomial, or array of polynomials of size(P1).


Element-wise euclidan division of the polynomial array P1 (scalar, vector, matrix or hypermatrix) by the polynomial P2 or by the polynomial array P2. R is the array of remainders, Q is the array of quotients, such that P1 = Q*P2 + R or P1 = Q.*P2 + R.


x = poly(0,'x');
p1 = (1+x^2)*(1-x);
p2 = 1-x;
[r,q] = pdiv(p1, p2)

// With polynomials with complex coefficients
p1 = (x-%i)*(x+2*%i);    printf("%s\n",string(p1))
p2 = 1-x;
[r, q] = pdiv(p1, p2);   printf("%s\n", string([r;q]))
p = q*p2 + r;            printf("%s\n", string(p)); // p1 expected

// Elementwise processing:
p1 = [1+x-x^2 , x^3-x+1];
p2 = [2-x , x^2-3];
[r,q] = pdiv(p1, p2)

See also

  • ldiv — polynomial matrix long division
  • pfss — partial fraction decomposition
  • gcd — Greatest (positive) Common Divisor
6.0.0 pdiv now returns a matrix of type 'constant' when all degrees are 0.
6.0.2 Extension to hypermatrices.
Report an issue
<< ldiv Polynomials pol2str >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 25 08:54:56 CET 2020