%% Access Element of 3-D Array
% Convert a linear index of a 3-D array to a subscript index.
% Create an array, and find the subscript index corresponding to the 14 th element of the array.

A = rand(3,4,2);
[row,col,page] = ind2sub(size(A),14)

% Check that both index versions refer to the same element of the array.

A(14)
A(row,col,page)

%
% Copyright 2019 The MathWorks, Inc.