Download this file

11 lines (9 with data), 175 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
function res = mtimes(A,x)
if A.adjoint == 0 %A*x
res = dct(x);
res = res(A.J);
else %At*x
z = zeros(A.n,1);
z(A.J) = x;
res = idct(z);
end