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 Comments

We can't execute your code, because the variable Silhouette is not defined.
if it is set at the top of the first part of the code.

Sign in to comment.

 Accepted Answer

DGM
DGM on 10 Apr 2022
Edited: DGM on 10 Apr 2022
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

More Answers (0)

Categories

Find more on Strategy & Logic in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!