i found this function as for morton scanning ..but i don no how to use it for morton scanning .. criteria is i have an image ..divided by 4*4 blocks .. 1 ,2,3 pixels are added and fourth pixel is divided by above sum .. i don no how to use this function ..
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