[Master Index]
[Index for /tools/hpmatlab/toolbox/matlab/datafun]
diff
(/tools/hpmatlab/toolbox/matlab/datafun/diff.m)
Function Synopsis
X = diff(X,nd,arg3)
Help text
DIFF Differentiate or difference.
DIFF may be called with either numeric or symbolic arguments.
For a numeric vector argument, DIFF computes differences.
DIFF(X), for a vector X, is [X(2)-X(1) X(3)-X(2) ... X(n)-X(n-1)].
DIFF(X), for a matrix X, is the matrix of column differences,
[X(2:n,:) - X(1:n-1,:)].
DIFF(X,n) is the n-th difference function.
For a symbolic (string) argument, DIFF uses the Symbolic Math Toolbox
to compute derivatives.
DIFF(S) differentiates S with respect to its free variable.
DIFF(S,'v') differentiates S with respect to 'v'.
DIFF(S,n) and DIFF(S,'v',n) differentiate S n times.
DIFF, with no arguments, differentiates the previous expression.
Examples;
With numeric arguments:
h = .001; x = 0:h:pi;
diff(sin(x.^2))/h is an approximation to 2*cos(x.^2).*x
diff((1:10).^2) is 3:2:19
With symbolic arguments and the Maple Symbolic Toolbox:
diff('sin(x^2)') is '2*cos(x^2)*x'
diff sin(x^2) is also '2*cos(x^2)*x'
diff('t^6',6) is '720'.
See also GRADIENT, DEL2, INT, SYMVAR.
Cross-Reference Information
This function calls
- else /tools/hpmatlab/toolbox/matlab/lang/else.m
- elseif /tools/hpmatlab/toolbox/matlab/lang/elseif.m
- end /tools/hpmatlab/toolbox/matlab/lang/end.m
- eval /tools/hpmatlab/toolbox/matlab/lang/eval.m
- for /tools/hpmatlab/toolbox/matlab/lang/for.m
- if /tools/hpmatlab/toolbox/matlab/lang/if.m
- nargin /tools/hpmatlab/toolbox/matlab/elmat/nargin.m
- size /tools/hpmatlab/toolbox/matlab/general/size.m
This function is called by
- axis /tools/hpmatlab/toolbox/matlab/graphics/axis.m
- bar /tools/hpmatlab/toolbox/matlab/plotxy/bar.m
- demod /tools/hpmatlab/toolbox/signal/demod.m
- dialog /tools/hpmatlab/toolbox/matlab/graphics/dialog.m
- filtdemo /tools/hpmatlab/toolbox/signal/filtdemo.m
- fir2 /tools/hpmatlab/toolbox/signal/fir2.m
- firls /tools/hpmatlab/toolbox/signal/firls.m
- fplot /tools/hpmatlab/toolbox/matlab/plotxy/fplot.m
- hist /tools/hpmatlab/toolbox/matlab/plotxy/hist.m
- remez /tools/hpmatlab/toolbox/signal/remez.m
- sosdemo /tools/hpmatlab/toolbox/signal/sosdemo.m
- trapz /tools/hpmatlab/toolbox/matlab/datafun/trapz.m
- unwrap /tools/hpmatlab/toolbox/matlab/datafun/unwrap.m
- yulewalk /tools/hpmatlab/toolbox/signal/yulewalk.m
- zplane /tools/hpmatlab/toolbox/signal/zplane.m
Produced by mat2html on Wed Feb 8 12:25:18 EST 1995
Cross-Directory links are: ON