y = dct2 (x) Computes the 2-D discrete cosine transform of matrix x y = dct2 (x, m, n) or y = dct2 (x, [m n]) Computes the 2-D DCT of x after padding or trimming rows to m and columns to n.