Z order (Morton Curve) for matrix .and Hausdorff distance.

9 vues (au cours des 30 derniers jours)
Pham Anh
Pham Anh le 23 Mai 2020
Hi everyone, I'm new and I'm doing a photo-processing project to recognize faces.
I have problem calculating the Z order for the matrix. I saw a code about it
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
But when I did it reported an error
>> Zorder(C)
Undefined function or variable 'mapping'.
Error in Zoder (line 6)
B = mapping(n/2);
Im working on Local Start Search algorithm

Réponses (1)

Srivardhan Gadila
Srivardhan Gadila le 26 Mai 2020
From the above information the function mapping calls itself recursively.
So if you simply renamed the function mapping to Zorder without adding more code or without making any other changes then you also have to change the line
B = mapping(n/2);
to
B = Zorder(n/2);
If you have done anything differently than mentioned above in the answer, then can you provide more details & reproduction steps?

Catégories

En savoir plus sur Graphics Object Programming dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by