How do I raise polynomials to various powers and then multiply them together?

4 ビュー (過去 30 日間)
James
James 2012 年 12 月 31 日
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 件のコメント
Image Analyst
Image Analyst 2012 年 12 月 31 日
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?
James
James 2012 年 12 月 31 日
My version/toolboxes: MATLAB Version: 7.14.0.739 (R2012a) MATLAB License Number: STUDENT Operating System: Microsoft Windows 7 Version 6.1 (Build 7601: Service Pack 1) Java Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot™ Client VM mixed mode ------------------------------------------------------------------------------------------------ MATLAB Version 7.14 (R2012a) Simulink Version 7.9 (R2012a) Control System Toolbox Version 9.3 (R2012a) DSP System Toolbox Version 8.2 (R2012a) Image Processing Toolbox Version 8.0 (R2012a) Optimization Toolbox Version 6.2 (R2012a) Signal Processing Toolbox Version 6.17 (R2012a) Simulink Control Design Version 3.5 (R2012a) Statistics Toolbox Version 8.0 (R2012a) Symbolic Math Toolbox Version 5.8
Now, suppose I have these polynomials: a = (x^2 + 4)^3 b = (x + 5) c = (e^ix +3x^4 + 2y + 4xy) and I want to compute d = a*b*c. How would I do that? I understand now how to make"pretty" from Walter Roberson's answer below, but would still like to know how handle products of powers of polynomials.

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2012 年 12 月 31 日
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 件のコメント
James
James 2012 年 12 月 31 日
Thanks.
Image Analyst
Image Analyst 2012 年 12 月 31 日
If it solved your question, mark it as "Accepted" next to his name.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangePolynomials についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by