Main Content

mtimes

Laurent polynomial or Laurent matrix multiplication

Since R2021b

    Description

    Q = mtimes(A,B) returns the product of the pair of Laurent polynomials or Laurent matrices A and B.

    Note

    The laurentPolynomial and laurentMatrix objects have their own versions of mtimes. The input data type determines which version is executed.

    example

    Q = A * B is equivalent to Q = mtimes(A,B).

    Examples

    collapse all

    Create three Laurent polynomials:

    • a(z)=4z+z-1

    • b(z)=2z2+3z+z-1

    • c(z)=z3+3z2+5z+7

    a = laurentPolynomial(Coefficients=[4 0 1],MaxOrder=1);
    b = laurentPolynomial(Coefficients=[2 3 0 1],MaxOrder=2);
    c = laurentPolynomial(Coefficients=[1 3 5 7],MaxOrder=3);

    Multiply a(z) and b(z).

    ab = mtimes(a,b)
    ab = 
      laurentPolynomial with properties:
    
        Coefficients: [8 12 2 7 0 1]
            MaxOrder: 3
    
    

    Compute a(z)c(z)-b(z).

    d = a*c-b
    d = 
      laurentPolynomial with properties:
    
        Coefficients: [4 12 19 28 5 6]
            MaxOrder: 4
    
    

    Create two Laurent polynomials:

    • a(z)=z+1

    • b(z)=z2-z-1

    lpA = laurentPolynomial(Coefficients=[1 1],MaxOrder=1);
    lpB = laurentPolynomial(Coefficients=[1 0 0 -1],MaxOrder=2);

    Create two Laurent matrices:

    • lmatA = [a(z)110]

    • lmatB = [023b(z)]

    lmatA = laurentMatrix(Elements={lpA,1;1,0});
    lmatB = laurentMatrix(Elements={0,2;3,lpB});

    Multiply the matrices.

    lmat = lmatA*lmatB;
    lmat.Elements{1,1}
    ans = 
      laurentPolynomial with properties:
    
        Coefficients: 3
            MaxOrder: 0
    
    
    lmat.Elements{1,2}
    ans = 
      laurentPolynomial with properties:
    
        Coefficients: [1 2 2 -1]
            MaxOrder: 2
    
    
    lmat.Elements{2,1}
    ans = 
      laurentPolynomial with properties:
    
        Coefficients: 0
            MaxOrder: 0
    
    
    lmat.Elements{2,2}
    ans = 
      laurentPolynomial with properties:
    
        Coefficients: 2
            MaxOrder: 0
    
    

    Input Arguments

    collapse all

    Laurent polynomial or Laurent matrix, specified as a laurentPolynomial object or a laurentMatrix object, respectively.

    Laurent polynomial or Laurent matrix, specified as a laurentPolynomial object or a laurentMatrix object, respectively.

    Output Arguments

    collapse all

    Product of two Laurent polynomials or two Laurent matrices, returned as a laurentPolynomial object or a laurentMatrix object.

    Extended Capabilities

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

    Version History

    Introduced in R2021b

    See Also

    Functions

    Objects