Code covered by the BSD License
function A = mapping(n) % To create a Morton Scan order matrix if n == 2 A = [1 2; 3 4]; else B = mapping(n/2); A = [B B+(n/2)^2; B+(n/2)^2*2 B+(n/2)^2*3]; end
Contact us at files@mathworks.com