function L = cardinal(x,t)
%
% The cardinal functions lk of x, evaluated in t. 
% t is a column vector. 
% Output: L = [l1(t),l2(t),....,ln(t)]
% 
n = length(x);
L = ones(length(t),n);
for k=1:n
    for i=1:n
        if i ~= k
            L(:,k) = L(:,k).*(t-x(i))/(x(k)-x(i));
        end
    end
end

            
    

