function X = pagectranspose(X)
%PAGECTRANSPOSE Page-wise complex conjugate transpose on each page of gpuArray.
%   
%   Y = PAGECTRANSPOSE(X) applies the complex conjugate transpose to each page of N-D array X:
%      Y(:,:,i) = X(:,:,i)'
%   
%   This is equivalent to calling permute(conj(X),[2 1 3:ndims(X)]).
%   


%   Copyright 2020 The MathWorks, Inc.

if ismatrix(X)
    X = ctranspose(X);
    return
end

X = pagefun(@ctranspose, X);

end
