Problem 44262. Multivariate polynomials - overload multiplication
Problems 44260 and 44261 work with a monomial representation of multivariate polynomials. This has two parts, a matrix exponents with a row of exponents for each monomial, and a column vector coefficients with a coefficient for each monomial.
It would be nice to define polynomials so they can be multiplied using simple notation:
p = p1*p2;
This can be done by defining a class mPoly with two properties, exponents and coefficients, and two methods: a constructor with the syntax
p = mPoly(exponents, coefficients)
and a method mtimes for multiplying two polynomials. You can assume that the polynomials being multiplied have the same number of variables.
Solution Stats
Problem Comments
-
1 Comment
Nice --- you don't see too many Cody problems involving classes.
Solution Comments
Show commentsProblem Recent Solvers13
Suggested Problems
-
Set the array elements whose value is 13 to 0
1426 Solvers
-
Generate a vector like 1,2,2,3,3,3,4,4,4,4
13491 Solvers
-
168 Solvers
-
Chebyshev polynomials of the 2nd Kind
77 Solvers
-
How many rectangles in a grid ?
78 Solvers
More from this Author9
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!