%% Differences Between Matrix Rows
% Create a 3-by-3 matrix, then compute the first difference between the rows.

X = [1 1 1; 5 5 5; 25 25 25];
Y = diff(X)

% Y is a 2-by-3 matrix.
% Copyright 2012 The MathWorks, Inc.