%% Flip N-D Array
% Create a 1-by-3-by-2 array.

A = zeros(1,3,2);
A(:,:,1) = [1 2 3];
A(:,:,2) = [4 5 6];
A

%
% Flip A without specifying the dim argument.

B = flip(A)

%
% Now, flip A along the third dimension.

B = flip(A,3)

% Copyright 2012 The MathWorks, Inc.