Help with numerical differentiation using difference tables

5 ビュー (過去 30 日間)
PJS KUMAR
PJS KUMAR 2018 年 9 月 5 日
編集済み: PJS KUMAR 2018 年 9 月 6 日
For the following data
x=[1:0.2:2.2]
y=[2.7183 3.3201 4.0552 4.9532 6.0496 7.3891 9.0250]
help me to write MATLAB code to find dy/dx value at any point xi using newton forward formula Help me to write MATLAB code after constructing difference table.
  2 件のコメント
Steven Lord
Steven Lord 2018 年 9 月 5 日
This sounds a lot like a homework problem. If it is, show us what you've tried so far to solve the problem and tell us specifically where you're having difficulty and we may be able to offer some guidance on how to proceed.
PJS KUMAR
PJS KUMAR 2018 年 9 月 6 日
編集済み: PJS KUMAR 2018 年 9 月 6 日
I have used to following code to construct the difference table
function fp = newton_fint( x,y,p )
n=length(x);
diff=y';
for j=2:n
for i=1:n-j+1
diff(i,j)=diff(i+1,j-1)-diff(i,j-1);
end
end
for i=1:n
for j=1:n
fprintf("%5.2f\t",diff(i,j));
end
fprintf("\n");
end
h=x(2)-x(1);
u=(p-x(1))/h;
How to create a vector with the elements u,u(u-1),u(u-1)(u-2),..... how to differentiate the elements of the above vector. help me in writing the MATLAB code using vector notations for the following formula for finding derivative at any x value

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeAdding custom doc についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by