As Walter shows, you can do it using provided tools easily enough. Just to understand how things work, you can also do it directly.
x = [1 2 3]'; syms z p = z.^(0:(numel(x)-1)); polynom = p*x
polynom = 3*z^2 + 2*z + 1
Note that the symbolic toolbox has chosen to reorder the terms.