%% Differences Between Vector Elements
% Create a vector, then compute the differences between the elements.

X = [1 1 2 3 5 8 13 21];
Y = diff(X)

% Note that Y has one fewer element than X.
% Copyright 2012 The MathWorks, Inc.