% mypoly - useful polynomial functions

clear
clc
format compact
syms s;

pp = (s-1)*(s+3)*(s-(1+j))*(s-(1-j))
p = expand (pp) % convert pole form to coefficient form
pf = factor(p)  % convert coefficient form to pole form

pc = [1 0 -5 10 -6]
pr = roots(pc)  % find roots of polynomial
pcr = poly(pr)  % find polynomial from roots

% Find and evaluate symbolic roots (limited by order of poly)
ps = solve (s^4 - 5*s^2 + 10*s - 6 == 0)
syms a b c
pss = solve (a*s^2 + b*s + c == 0)
a=1, b=2
eval(pss)