function sum = polyEval(coeff, x)
% polyEval(coeff, x): Evaluate polynomial at x.
% Vector coeff contains the coefficients; coeff(0) is the constant term.

sum = 0;
for k = 1:length(coeff)
    sum = sum + coeff(k)*x^(k-1);
end
