According to Wikipedia, "Multidimensional variants of the various DCT types follow straightforwardly from the one-dimensional definitions: they are simply a separable product (equivalently, a composition) of DCTs along each dimension."
Following this, you should be able to get the 2d-DCT by computing
dct(dct(A.').')
There's also dct2
in the Image Processing Toolbox, and the core of the implementation is
b = dct(a, mpad);
if m > 1 && n > 1, b = dct(b.', npad).'; end