📄 compute_diff.m
字号:
function y = compute_diff(x,order,options)
% compute_diff - compute central derivative (of order 'order') of a vector.
%
% y = compute_diff(x,order,options);
%
% 'options' is a structure:
% - options.h is the sampling step size (default 1).
% - options.type is the kind of finite difference.
% type==1 is for forward differences, ie.
% y(i) = (x(i+1)-x(i-1))/(2h), with special
% care at boundaries.
% type==2 is fwd differences, ie.
% y(i) = (x(i+1)-x(i))/h, with special
% care at boundaries.
% type==2 is fwd differences, ie.
% y(i) = (x(i)-x(i-1))/h, with special
% care at boundaries.
%
% Copyright (c) 2004 Gabriel Peyr
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -