www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/FlipMultidimensionalArrayExample.m

    %% Flip Multidimensional Array  

%% 
% Create a multidimensional array. 
A = cat(3, [1 2; 3 4], [5 6; 7 8]) 

%%
% |A| is an array of size 2-by-2-by-2.  

%% 
% Flip the elements on each page of |A| in the horizontal direction. 
B = fliplr(A) 

%%
% The result, |B|, is the same size as |A|, but the horizontal order of
% the elements is flipped. The operation flips the elements on each page
% independently.