How do I raise polynomials to various powers and then multiply them together?
4 views (last 30 days)
Show older comments
What is the easiest way to multiply a series of polynomials, some of which are to be squared or cubed or raised to some other power? Also, is there any way to generate output that looks like the sort of typeset polynomial one would see in a textbook as opposed to a concatenation of integers?
4 Comments
Image Analyst
on 31 Dec 2012
Type ver on the command line to show what toolboxes you have. What do you mean by "a series of polynomials"? Do you have a bunch of equations rather than a numerical values for them at certain range of x values? Do you want to print out formulas with superscripts and Greek letters and other mathematical symbols onto figures, axes, or static text labels on GUIs?
Answers (1)
Walter Roberson
on 31 Dec 2012
syms x
p1 = 5*x^3 - 7*x^2 - 9*x + 11;
p2 = 5*x^4 + 4*x^3 + 3*x^2 + 2*x + 1;
p3 = p1 * p2;
p3
pretty(p3)
p4 = expand(p3);
p4
pretty(p4);
3 Comments
See Also
Categories
Find more on Polynomials in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!