필터 지우기
필터 지우기

gauss forward interpolation method

조회 수: 9 (최근 30일)
PJS KUMAR
PJS KUMAR 2018년 10월 18일
편집: Torsten 2018년 10월 18일
I wrote the following code for gauss interpolation
function [ yval ] = gauss_p( xd,yd,xp )
n=length(xd);
if(length(yd)==n)
tbl=yd';
for j=2:n
for i=1:n-j+1
tbl(i,j)=tbl(i+1,j-1)-tbl(i,j-1);
end
end
tbl
h=xd(2)-xd(1);
if rem(n,2)==0
k=n/2+1;
else
k=n/2+0.5;
end
p=(xp-xd(k))/h
pt=cumprod([1,p-(0:n-3)])
dt=[tbl(k,1) tbl(k,2) tbl(k-1,3)+tbl(k-1,4) tbl(k-1,4)+tbl(k-1,5) tbl(k-1,5)+tbl(k-1,6) tbl(k-1,6)+tbl(k-1,7)]./factorial(0:n-2)
yval=sum(pt.*dt)
end
Suggest me to simplify the calculation of 'dt' vector subject to 'n' values

답변 (1개)

Torsten
Torsten 2018년 10월 18일
편집: Torsten 2018년 10월 18일
dt = [tbl(k,1), tbl(k,2), tbl(k-1,3:n-1)-tbl(k-1,4:n)]./factorial(0:n-2)
?
Best wishes
Torsten.

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by