@(p,q)poly([roots(p);roots(q)])*p(1)*q(1) ans([1,1], [1,4,6,4,1])
Standard input is empty
ans = @(p, q) poly ([roots(p); roots(q)]) * p (1) * q (1) ans = Columns 1 through 3: 1.00000 + 0.00000i 5.00000 + 0.00000i 10.00000 - 0.00000i Columns 4 through 6: 10.00000 - 0.00000i 5.00000 - 0.00000i 1.00000 + 0.00000i