
- MATLAB - Home
- MATLAB - Overview
- MATLAB - Features
- MATLAB - Environment Setup
- MATLAB - Editors
- MATLAB - Online
- MATLAB - Workspace
- MATLAB - Syntax
- MATLAB - Variables
- MATLAB - Commands
- MATLAB - Data Types
- MATLAB - Operators
- MATLAB - Dates and Time
- MATLAB - Numbers
- MATLAB - Random Numbers
- MATLAB - Strings and Characters
- MATLAB - Text Formatting
- MATLAB - Timetables
- MATLAB - M-Files
- MATLAB - Colon Notation
- MATLAB - Data Import
- MATLAB - Data Output
- MATLAB - Normalize Data
- MATLAB - Predefined Variables
- MATLAB - Decision Making
- MATLAB - Decisions
- MATLAB - If End Statement
- MATLAB - If Else Statement
- MATLAB - If…Elseif Else Statement
- MATLAB - Nest If Statememt
- MATLAB - Switch Statement
- MATLAB - Nested Switch
- MATLAB - Loops
- MATLAB - Loops
- MATLAB - For Loop
- MATLAB - While Loop
- MATLAB - Nested Loops
- MATLAB - Break Statement
- MATLAB - Continue Statement
- MATLAB - End Statement
- MATLAB - Arrays
- MATLAB - Arrays
- MATLAB - Vectors
- MATLAB - Transpose Operator
- MATLAB - Array Indexing
- MATLAB - Multi-Dimensional Array
- MATLAB - Compatible Arrays
- MATLAB - Categorical Arrays
- MATLAB - Cell Arrays
- MATLAB - Matrix
- MATLAB - Sparse Matrix
- MATLAB - Tables
- MATLAB - Structures
- MATLAB - Array Multiplication
- MATLAB - Array Division
- MATLAB - Array Functions
- MATLAB - Functions
- MATLAB - Functions
- MATLAB - Function Arguments
- MATLAB - Anonymous Functions
- MATLAB - Nested Functions
- MATLAB - Return Statement
- MATLAB - Void Function
- MATLAB - Local Functions
- MATLAB - Global Variables
- MATLAB - Function Handles
- MATLAB - Filter Function
- MATLAB - Factorial
- MATLAB - Private Functions
- MATLAB - Sub-functions
- MATLAB - Recursive Functions
- MATLAB - Function Precedence Order
- MATLAB - Map Function
- MATLAB - Mean Function
- MATLAB - End Function
- MATLAB - Error Handling
- MATLAB - Error Handling
- MATLAB - Try...Catch statement
- MATLAB - Debugging
- MATLAB - Plotting
- MATLAB - Plotting
- MATLAB - Plot Arrays
- MATLAB - Plot Vectors
- MATLAB - Bar Graph
- MATLAB - Histograms
- MATLAB - Graphics
- MATLAB - 2D Line Plot
- MATLAB - 3D Plots
- MATLAB - Formatting a Plot
- MATLAB - Logarithmic Axes Plots
- MATLAB - Plotting Error Bars
- MATLAB - Plot a 3D Contour
- MATLAB - Polar Plots
- MATLAB - Scatter Plots
- MATLAB - Plot Expression or Function
- MATLAB - Draw Rectangle
- MATLAB - Plot Spectrogram
- MATLAB - Plot Mesh Surface
- MATLAB - Plot Sine Wave
- MATLAB - Interpolation
- MATLAB - Interpolation
- MATLAB - Linear Interpolation
- MATLAB - 2D Array Interpolation
- MATLAB - 3D Array Interpolation
- MATLAB - Polynomials
- MATLAB - Polynomials
- MATLAB - Polynomial Addition
- MATLAB - Polynomial Multiplication
- MATLAB - Polynomial Division
- MATLAB - Derivatives of Polynomials
- MATLAB - Transformation
- MATLAB - Transforms
- MATLAB - Laplace Transform
- MATLAB - Laplacian Filter
- MATLAB - Laplacian of Gaussian Filter
- MATLAB - Inverse Fourier transform
- MATLAB - Fourier Transform
- MATLAB - Fast Fourier Transform
- MATLAB - 2-D Inverse Cosine Transform
- MATLAB - Add Legend to Axes
- MATLAB - Object Oriented
- MATLAB - Object Oriented Programming
- MATLAB - Classes and Object
- MATLAB - Functions Overloading
- MATLAB - Operator Overloading
- MATLAB - User-Defined Classes
- MATLAB - Copy Objects
- MATLAB - Algebra
- MATLAB - Linear Algebra
- MATLAB - Gauss Elimination
- MATLAB - Gauss-Jordan Elimination
- MATLAB - Reduced Row Echelon Form
- MATLAB - Eigenvalues and Eigenvectors
- MATLAB - Integration
- MATLAB - Integration
- MATLAB - Double Integral
- MATLAB - Trapezoidal Rule
- MATLAB - Simpson's Rule
- MATLAB - Miscellenous
- MATLAB - Calculus
- MATLAB - Differential
- MATLAB - Inverse of Matrix
- MATLAB - GNU Octave
- MATLAB - Simulink
MATLAB - Polynomial Multiplication
Polynomial multiplication is a fundamental operation in mathematics and engineering, especially in fields like signal processing, control theory, and numerical analysis. In MATLAB, polynomial multiplication can be performed using the conv function or the * operator.
Polynomial Multiplication Using conv Function
In MATLAB, polynomial multiplication can be efficiently performed using the conv function, which calculates the convolution of two sequences, representing the coefficients of the polynomials. Since the convolution of two polynomials is equal to their product, the conv function can be used for polynomial multiplication.
Let's consider we have two polynomials as shown below −
P(x) = 2x2 + 3x + 4 Q(x) = 5x + 6
The coefficients for above polynomials equations are as follows −
P = [2 3 4]; % Coefficients of P(x) Q = [5 6]; % Coefficients of Q(x)
Now let us use conv function to multiply the two polynomials.
R = conv(P, Q); % Result of polynomial multiplication
The result R will be the coefficients of the polynomial product which is nothing but.
R(x) = P(x).Q(x)
So if you want to execute the code and see the output we can use the following code −
P = [2 3 4]; % Coefficients of P(x) Q = [5 6]; % Coefficients of Q(x) R = conv(P, Q); % Result of polynomial multiplication disp(R)
On execution the output is as follows −

The final polynomial we have is,
R(x) = 10x3 + 27x2 + 38x + 24
Let us try another example using conv() function
Example 1: Polynomial P(x) = 3x2 + 2x + 1 and Q(x) = 4x3 + 5x2 + 6x + 1 Multiplication
The polynomials we have is as follows −
P(x) = 3x2 + 2x + 1 Q(x) = 4x3 + 5x2 + 6x + 1
The coefficients from above polynomials is as follows −
P = [3 2 1]; % Coefficients of P(x) Q = [4 5 6 7]; % Coefficients of Q(x)
So the final code we can execute is as follows −
P = [3 2 1]; % Coefficients of P(x) Q = [4 5 6 7]; % Coefficients of Q(x) R = conv(P,Q); disp(R);
When the code is executed in matlab command window the output is −

The output we get for R is [12 23 32 38 20 7]; so the final polynomial we get is −
R(x) = 12x5 + 23x4 + 32x3 + 38x2 + 20x + 7
Example 2: Multiplying Two Quadratic Polynomials
Consider the following,
Polynomials: P(x)=x2+2x+3 Q(x)=4x2+5x+6 Coefficients: P = [ 1 2 3 ] Q = [ 4 5 6 ]
The code in Matlab we have is,
% Define the coefficients of the polynomials P = [1 2 3]; % Coefficients of P(x) = x^2 + 2x + 3 Q = [4 5 6]; % Coefficients of Q(x) = 4x^2 + 5x + 6 % Perform the polynomial multiplication result = conv(P, Q); % Display the result disp('Resulting polynomial coefficients after multiplication:'); disp(result);
For the polynomials,
P(x) = x2 + 2x + 3 and Q(x) = 4x2 + 5x + 6 , the product is: (x2 + 2x + 3) (4x2 +5x +6) = 4x4 + 13x3 + 28x2 + 27x + 18
When the code is executed in matlab command window the output is −
>> % Define the coefficients of the polynomials P = [1 2 3]; % Coefficients of P(x) = x^2 + 2x + 3 Q = [4 5 6]; % Coefficients of Q(x) = 4x^2 + 5x + 6 % Perform the polynomial multiplication result = conv(P, Q); % Display the result disp('Resulting polynomial coefficients after multiplication:'); disp(result); Resulting polynomial coefficients after multiplication: 4 13 28 27 18 >>
Example 3: Multiplying a Cubic Polynomial by a Linear Polynomial
We have,
Polynomials: P(x) =3x3 +2x2 +x+4 Q(x) = x2 Coefficients: P = [ 3 2 1 4 ] Q = [ 1 2 ]
The matlab code we have is -
% Define the coefficients of the polynomials P = [3 2 1 4]; % Coefficients of P(x) = 3x^3 + 2x^2 + x + 4 Q = [1 -2]; % Coefficients of Q(x) = x - 2 % Perform the polynomial multiplication result = conv(P, Q); % Display the result disp('Resulting polynomial coefficients after multiplication:'); disp(result);
When the code is executed the output we have is −
>> % Define the coefficients of the polynomials P = [3 2 1 4]; % Coefficients of P(x) = 3x^3 + 2x^2 + x + 4 Q = [1 -2]; % Coefficients of Q(x) = x - 2 % Perform the polynomial multiplication result = conv(P, Q); % Display the result disp('Resulting polynomial coefficients after multiplication:'); disp(result); Resulting polynomial coefficients after multiplication: 3 -4 -3 2 -8 >>