91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 561B
    文件類(lèi)型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-06-13
  • 語(yǔ)言: Matlab
  • 標(biāo)簽: 拉格朗日??

資源簡(jiǎn)介

拉格朗日插值法程序 n=size(pointx,2); L=ones(n,size(x,2)); if (size(pointx,2)~=size(pointy,2)) fprintf(1,'\nERROR!\nPOINTX and POINTY must have the same number of elements\n'); y=NaN; else for i=1:n for j=1:n if (i~=j) L(i,:)=L(i,:).*(x-pointx(j))/(pointx(i)-pointx(j)); end end end y=0; for i=1:n y=y+pointy(i)*L(i,:); end end

資源截圖

代碼片段和文件信息

function?y=lagrange(xpointxpointy)
%
%LAGRANGE???approx?a?point-defined?function?using?the?Lagrange?polynomial?interpolation
%
%??????LAGRANGE(XPOINTXPOINTY)?approx?the?function?definited?by?the?points:
%??????P1=(POINTX(1)POINTY(1))?P2=(POINTX(2)POINTY(2))?...?PN(POINTX(N)POINTY(N))
%??????and?calculate?it?in?each?elements?of?X
%
%??????If?POINTX?and?POINTY?have?different?number?of?elements?the?function?will?return?the?NaN?value
%
%??????function?wrote?by:?Calzino
%??????7-oct-2001
%
n=size(pointx2);
L=ones(nsize(x2));
if?(size(pointx2)~=size(pointy2))
???fprintf(1‘\nERROR!\nPOINTX?and?POINTY?must?have?the?same?number?of?elements\n‘);
???y=NaN;
else
???for?i=1:n
??????for?j=1:n
?????????if?(i~=j)
????????????L(i:)=L(i:).*(x-pointx(j))/(pointx(i)-pointx(j));
?????????end
??????end
???end
???y=0;
???for?i=1:n
??????y=y+pointy(i)*L(i:);
???end
end

?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件?????????908??2001-10-07?23:08??lagrange.m

評(píng)論

共有 條評(píng)論