%
% Interpolación lineal básica.
%

senexp = @(x) (exp(-x / 2) .* sin((exp(x) - 1) / 2));

xtable = 0:0.05:5;
ytable = senexp(xtable);
ntable = length(xtable);

setintertable(ntable, xtable, ytable);

yyy = interpol2(2.71828384)
fprintf('2da llamada:\n');
yyy = interpol2(1.75)
senexp(1.75)
return;

xfun = 0:0.001:5;
yfun = senexp(xfun);

close all;
plot(xfun, yfun, '-g');
hold on;

yint = xfun;

for i = 1:length(xfun)
  yint(i) = interpol2(xfun(i));
end

plot(xfun, yint, '-r');

figure;
plot(xfun, yfun, '-g');
xlim([4.63 4.67]);
hold on;
plot(xfun, yint, '-r');

