derivative

버전 1.1.0.0 (2.13 KB) 작성자: Scott McKinney
Compute derivative while preserving dimensions
다운로드 수: 3.3K
업데이트 날짜: 2010/10/17

라이선스 보기

% DERIVATIVE Compute derivative while preserving dimensions
%
% DERIVATIVE(X), for a vector X, is an estimate of the first derivative of X.
% DERIVATIVE(X), for a matrix X, is a matrix containing the first
% derivatives of the columns of X.
% DERIVATIVE(X,N) is the Nth derivative along the columns of X.
% DERIVATIVE(X,N,DIM) is the Nth derivative along dimension DIM of X.
%
% DERIVATIVE averages neighboring values of the simple finite differencing
% method to obtain an estimate of the derivative that is exactly the same
% size as X. This stands in contrast to Matlab's built-in DIFF, which, when
% computing a derivative of order N on length M vectors, produces a vector
% of length M-N. DERIVATIVE is therefore useful for estimating derivatives
% at the same points over which X is defined, rather than in between
% samples (as occurs implicity when using Matlab's DIFF). This means that,
% for example, dX can be plotted against the same independent variables as
% X. Note that the first and last elements of DERIVATIVE(X) will be the
% same as those produced by DIFF(X).
%
% For N > 1, DERIVATIVE operates iteratively N times. If N = 0, DERIVATIVE
% is the identity transformation. Use caution when computing derivatives
% for N high relative to size(X,DIM). A warning will be issued.
%
% Unless DIM is specified, DERIVATIVE computes the Nth derivative
% along the columns of a matrix input.

EXAMPLE:

t = linspace(-4,4,500);
x = normpdf(t);
dx = derivative(x);
dt = derivative(t);
plot(t,x,t,dx./dt);

인용 양식

Scott McKinney (2024). derivative (https://www.mathworks.com/matlabcentral/fileexchange/28920-derivative), MATLAB Central File Exchange. 검색됨 .

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

줌: diffxy, DGradient, hilbert2

Community Treasure Hunt

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

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

A small efficiency update based on helpful comments from Jan Simon. Should be updated soon to handle N-D arrays.

1.0.0.0