How can I put subscripts on a polynomial of degree n?

2 views (last 30 days)
I want to the following polynomial, to write the input argument p,with subscripts:
y=p1*x^n+p2*x^(n-1)+...+pn+1,
not the way it is written.
  4 Comments
Stephen23
Stephen23 on 25 Aug 2017
Edited: Stephen23 on 25 Aug 2017
"That answer was not helpful..."
Your question is unclear. Raw text does not have subscripts, superscripts, or any other formatting. Like most programming languages MATLAB is written in raw text. If you want to display that formula with subscripts then you need to tell us where you want to display it.
Walter Roberson
Walter Roberson on 25 Aug 2017
Note: the Extended Symbolic Math Toolbox has been obsolete since R2008a, so if that is what is being used it should be emphasized as the display options have changed.

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 25 Jul 2015
N = 10;
P = sym('p', [1, N]);
syms x
y = poly2sym(P, x);

Tags

Community Treasure Hunt

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

Start Hunting!