function [ S ] = evalapoly( p, x )
%EVALAPOLY is an implementation of polyval
%   Example we did as a gentle intro to polynomials
%   Minas Spetsakis, Nov. 2018

S = 0;
for i=1:length(p)
    S = S*x + p(i);
end

end

