function p = Horner(a,t)
% Evaluate a polynomial using Horner's method
% Polynomial is assumed to have the form
% a(1) + a(2)*t + a(3)*t^2 + ... + a(n+1)*t^n
% INPUT: a = vector of n+1 coefficients
%        t = vector containing arguments of the polynomial
% OUTPUT:p = vector containing values of the poly. at those points
% K. Ming Leung, 02/26/03

N=length(a);    % N=n+1
p = a(N);
for k=N-1:-1:1
    p = a(k)+p.*t;
end
