Main Content

mpower

Laurent polynomial exponentiation

Since R2021b

    Description

    example

    Q = mpower(P,pow) raises the Laurent polynomial P to the power pow.

    Q = P^pow is equivalent to Q = mpower(p,pow).

    Examples

    collapse all

    Create two Laurent polynomials:

    • a(z)=z-1

    • b(z)=-2z3+6z2-6z+2

    a = laurentPolynomial(Coefficients=[1 -1],MaxOrder=1);
    b = laurentPolynomial(Coefficients=[-2 6 -6 2],MaxOrder=3);

    Raise a(z) to the third power. Confirm the result is not equal to b(z).

    a3 = a^3;
    a3 ~= b
    ans = logical
       1
    
    

    Confirm a(z) raised to the third power is equal to -b(z)/2.

    b2 = rescale(b,-1/2);
    a3 == b2
    ans = logical
       1
    
    

    Input Arguments

    collapse all

    Laurent polynomial, specified as a laurentPolynomial object.

    Power, specified as an integer. If pow is negative, P must be a monomial.

    Example: Q = mpower(lp,3) raises the Laurent polynomial lp to the third power.

    Data Types: double

    Output Arguments

    collapse all

    Laurent polynomial raised to a nonzero power, returned as a laurentPolynomial object.

    Extended Capabilities

    C/C++ Code Generation
    Generate C and C++ code using MATLAB® Coder™.

    Version History

    Introduced in R2021b