hitN =[000;010;111];
missN =[111;000;000];
hitS =[111;010;000];
missS =[000;000;111];
hitE =[100;110;100];
missE =[001;001;001];
hitO =[001;011;001];
missO =[100;100;100];
hitNE =[000;110;010];
missNE =[011;001;000];
hitSE =[010;110;000];
missSE =[000;001;011];
hitNO =[000;011;010];
missNO =[110;100;000];
hitSO =[010;011;000];
missSO =[000;100;110];
Squel = Silhouette;
SquelPrecedent = 0;
while(~isequal(Squel, SquelPrecedent))
SquelPrecedent = Squel;
hmN = imerode(Squel, hitN) & imerode(~Squel, missN);
hmS = imerode(Squel, hitS) & imerode(~Squel, missS);
* hmE = imerode(Squel, hitE) & imerode(~Squel, missE);
hmO = imerode(Squel, hitO) & imerode(~Squel, missO);
hm = hmN | hmS | hmE | hmO;
my code blocks at the line where there is *
error message: Error in TP2 (line 79)
hmE = imerode(Squel, hitE) & imerode(~Squel, missE);

2 Kommentare

the cyclist
the cyclist am 9 Apr. 2022
We can't execute your code, because the variable Silhouette is not defined.
Yahia Samed Gabous
Yahia Samed Gabous am 9 Apr. 2022
if it is set at the top of the first part of the code.

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

DGM
DGM am 10 Apr. 2022
Bearbeitet: DGM am 10 Apr. 2022

0 Stimmen

This:
hitE = [100; 110; 100]
hitE = 3×1
100 110 100
is not the same as this:
hitE = [1 0 0; 1 1 0; 1 0 0]
hitE = 3×3
1 0 0 1 1 0 1 0 0

Weitere Antworten (0)

Kategorien

Mehr zu Strategy & Logic finden Sie in Hilfe-Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by