function [Y] = Intpol_Lagrange(x,y,X) n = length(x); for i = 1:n L(i) = 1; % Calcula os termos Li do produtório for j = 1:n if j ~= i L(i) = L(i)*(X - x(j))/(x(i)-x(j)); end end end Y = y*(L'); end