-
Notifications
You must be signed in to change notification settings - Fork 0
/
solve_image.m
49 lines (36 loc) · 1.06 KB
/
solve_image.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
% Draw large bounding box:
xstart = 0;
ystart = 0;
xlen = length(rejilla);
ylen = xlen;
figure
rectangle('position', [xstart, ystart, xlen, ylen])
set(gca,'XAxisLocation','top','YAxisLocation','left','ydir','reverse');
% Draw smaller boxes
dx = 1;
dy = 1;
nx = floor(xlen/dx);
ny = floor(ylen/dy);
for i = 1:nx
x = xstart + (i-1)*dx;
for j = 1:ny
y = ystart + (j-1)*dy;
rectangle('position', [x, y, dx, dy])
for i=1:l %color negro paredes
for j=1:l
if (savem(i,j)==2)
rectangle('position', [j-1, i-1, dx, dy], 'facecolor', 'black')
end
end
end
for z=1:length(individuo)
for i=1:l %color camino solucion
for j=1:l
if (rejilla(i,j)==individuo(z))
rectangle('position', [j-1, i-1, dx, dy], 'facecolor', 'r')
end
end
end
end
end
end