| DSP Blockset | Search  Help Desk |
| Difference | See Also |
Compute the element-to-element difference along a vector.
Library
Vector Functions, in Math FunctionsDescription
The Difference block computes the difference between successive vector elements. That is, for an input vector u of length N,y = [u(2)-u(1) u(3)-u(2) ... u(N)-u(N-1)]or
y = diff(u) % equivalent MATLAB codeThe output is a vector of length N-1. A matrix input,
u, is treated as a vector, u(:).
Note
Dialog Box

See Also
Cumulative Sumdiff (MATLAB)