You are on page 1of 1

function [r] = interpolacionCuadratica17(mx, my)

%Entrdas: mx, my
%Salidas: funcion evaluacion--> otra funcion

syms x;
A = zeros(3,2);

for i=1:3
A(i,1) = mx(i,1);
A(i,2) = my(i,1);
end

%Formulas Interpolacion Cuadr�tica


b0 = A(1,2);
b1 = (A(2,2)-A(1,2))/(A(2,1)-A(1,1));
b2 = ((A(2,1)-A(1,1))*(A(3,2)-A(1,2))-(A(2,2)-A(1,2))*(A(3,1)-A(1,1)))/((A(2,1)-
A(1,1))*(A(3,1)-A(1,1))*(A(3,1)-A(2,1)));

%Formulas General de IC
fx = b0+b1*(x-A(1,1))+b2*(x-A(1,1))*(x-A(2,1));

fx = expand(fx);
fx = vpa(fx,4);
r = char(fx);

You might also like