% 1-topshiriq 16-raqam (7 va 9 topshiriq taqsimotiga ko'ra)
%7-raqam
x=[0.115; 0.225; 0.335; 0.445; 0.555; 0.665];
y=[8.6572; 7.9582; 7.3623; 6.8481; 6.3998; 6.0055];
p=vander(x)\y 
% nuqtaning qiymatini hisoblash
x1=0.15
y1=polyval(p,x1)
% grafigi
x2=[0.115: 0.01: 0.75];
y2=polyval(p,x2);
plot(x2,y2)
% aproksimatsiyasi
x=[0.115; 0.225; 0.335; 0.445; 0.555; 0.665];
y=[8.6572; 7.9582; 7.3623; 6.8481; 6.3998; 6.0055];
polyfit(x,y,5)
%Taxminiy qiymatini hisoblash
xi=0.15
yi=interp1(x,y,xi)
yi=interp1(x,y,xi,'linear')
yi=interp1(x,y,xi,'pchip')
yi=interp1(x,y,xi,'nearest')
yi=interp1(x,y,xi,'spline')
yi=spline(x,y,xi)



% 1-topshiriq 9-raqam

% Berilgan x va y qiymatlari
x=[0.15; 0.27; 0.39; 0.51; 0.63; 0.75];
y=[4.481; 5.473; 6.685; 8.166; 9.974; 12.182];

% Interpolyatsion ko'phad
p=vander(x)\y

% Nuqtaning qiymatini hisoblash
x1=0.240
y1=polyval(p,x1)
% Grafikni chizish
x2=0.15:0.01:0.75;
y2=polyval(p,x2);
plot(x2,y2)


% Approksimatsiya
x=[0.15; 0.27; 0.39; 0.51; 0.63; 0.75];
y=[4.481; 5.473; 6.685; 8.166; 9.974; 12.182];
polyfit(x,y,5)

% Taxminiy qiymatini hisoblash
xi=0.240
yi=interp1(x,y,xi)
yi=interp1(x,y,xi,'linear')
yi=interp1(x,y,xi,'pchip')
yi=interp1(x,y,xi,'nearest')
yi=interp1(x,y,xi,'spline')
yi=spline(x,y,xi)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: