% |x-x1||x-x2|...|x-xn| is large when x is close to the end points.

syms t;
x = [1 2 3 4 5 6 7 8];
n = length(x);
P = 1;
for i = 1:n
    P = P*(t-x(i));
end
ezplot(P, [min(x) max(x)])
hold on
Q = @(y) 0;
ezplot(Q, [min(x) max(x)])