Numerical Differentiation

버전 1.2.0.0 (249 KB) 작성자: Husam Aldahiyat
Performs single dimensional differentiation numerically.
다운로드 수: 3.2K
업데이트 날짜: 2009/2/3

라이선스 보기

This is a GUI which performs numerical differentiation of a function over a number of equaly spaced points. Also with it is a code that grants the coefficients used for numerical differentiation.

The pictures and example should be more than enough for understanding how to use the file.

Example:

npoints=3;
Order=1;
d=datnum(npoints,Order)
d=
-1.5 2 -0.5 % Forward
-0.5 -0 0.5 % Central
0.5 -2 1.5 % Backward

% The result is a matrix consisting of coefficients that can be
% used to numerically differentiate, like this:

x=1;
f=inline('cos(x)')
h=.1;

s = ( d(1,1)*f(x) + d(1,2)*f(x+h) + d(1,3)*f(x+2*h) )/h^Order
s =
-0.8444

s = ( d(2,1)*f(x-h) + d(2,2)*f(x) + d(2,3)*f(x+h) )/h^Order
s =
-0.84007

s = ( d(3,1)*f(x-2*h) + d(3,2)*f(x-h) + d(3,3)*f(x) )/h^Order
s =
-0.84413

% The true answer is s = -0.84147

The code uses the Symbolic Math Toolbox to obtain the true value (in order to calculate the error). If you don't have the Symbolic Math Toolbox then you won't enjoy this benefit (program still works though).

인용 양식

Husam Aldahiyat (2024). Numerical Differentiation (https://www.mathworks.com/matlabcentral/fileexchange/22807-numerical-differentiation), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2007a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.2.0.0

Edited description

1.1.0.0

Symbolic Math Toolbox is now an optional feature

1.0.0.0