Documentos de Académico
Documentos de Profesional
Documentos de Cultura
x 1 2 3
f(x) 3 5 1
𝑥² − 5𝑥 + 6 𝑥² − 4𝑥 + 3 𝑥² − 3𝑥 + 2
𝑃(𝑥) = ( ).3 + ( ).5 + ( ).1
2 −1 2
𝑥² − 3𝑥 + 2
𝑃(𝑥) = (1,5𝑥² − 7.5𝑥 + 9) + (−5𝑥^2 + 20𝑥 − 15) + ( ).1
2
2
𝑥2
𝑃(𝑥) = 1,5𝑥² − 7.5𝑥 + 9 − 5𝑥 + 20𝑥 − 15 + − 1,5𝑥 + 1
2
𝑃(𝑥) = −3𝑥 2 + 11𝑥 − 5
b) forme o polinômio de Newton;
function yi = letra_a_lagrange(x,y,f,xi)
% f -> inline(‘função’);
For
int = 1:length(xi),
xint = xi(int)
end
plot(xi,f(xi),’r’, x, y,’g*’);
grid;
xlabel(‘x’);
ylabel(‘y’);
legend
clc
clear all;
function yi = letra_a_lagrange(x,y,xi)
%datos:
clc
fx=[5; 9; 2; 1; 6; 4; 9];
%Número de muestras
N=length(x);
for k=1:N
for m=1:N
if k==m
ind=1;
else
end
end
ind =0;
end
for k=1:N
CN(k,:)=poly(FN(k,:));
end
Fac=prod(FD,2);
for k=1:N
multi(k,:)=CN(k,:)*fx(k)/Fac(k);
end
Coef=sum(multi);
%Crear vector para evaluar los puntos entre el limite inferior y superior
%del vector x.
xp=(2:0.01:14);
Fxp=polyval(Coef,xp);
plot(x,fx,'o',xp,Fxp,'r');
https://www.academia.edu/5307695/Interpolaci%C3%B3n_Polinomial