% This is a short example of how
% to use ind2sub
I = zeros(4,4,3);
I(4,3,2) = 1;
index = find(I);
[ii,jj,kk] = ind2sub(size(I),index)
% 4, 3, 2 as it should be
% help ind2sub % for more info