SELAMAT DATANG

INTERPOLASI LINIER

clc
clear all
x=5;
x1=2.1;
x2=4.5;
y1=3;
y2=5.5;
disp('================')
disp(' i     x      y ')
disp('================')
for i=1:20
    y=y1+((x-x1)*(y2-y1)/(x2-x1));
    fprintf('%3g %5.2f  %5.2f \n',i,x,y)
    x=x+1;
end

0 komentar:

Posting Komentar

Flag Counter