%% Differences Between Matrix Columns
% Create a 3-by-3 matrix, then compute the first-order difference between the columns.

X = [1 3 5;7 11 13;17 19 23];
Y = diff(X,1,2)

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