0
votes

I have a coefficient column vector looking something like

x = [1 2 3]'

that aligns with the polynomial p(z) = x_0 + x_1*z + x_2*z^2 + ... + x_n-1*z^(n-1). My question is, how would one create a symbolic vector using MATLAB, something like

p = [1 z z^2]

so that when I take the matrix product

p*x

and print it I get a 1x1 "matrix" of the expression 1 + 2z + 3z^2?

Furthermore, how can I generalize the creation of p to extend for arbitrary powers z^3, z^4, ...?

Thanks!

1
You might not need symbolic stuff here at all. Take a look at polyval, I think it does just what you are looking for.Cris Luengo

1 Answers

1
votes
p = z.^(0:2);

In general:

p = z.^(0:n-1);

where n equals number of elements.