-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcsw_E2_Q2.m
More file actions
43 lines (43 loc) · 801 Bytes
/
csw_E2_Q2.m
File metadata and controls
43 lines (43 loc) · 801 Bytes
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
%E2Q2: Box Grid w/Yellows
clc;clear;
boxes = input('Enter the number of boxes in a row: ');
w = (5*boxes) + (boxes+1);
grid = uint8(zeros(w,w,3));
grid(:,:,:) = 255;
%Black Lines
for ii=1:6:w
grid(ii,:,:) = 0;
end
for jj=1:6:w
grid(:,jj,:) = 0;
end
%Make it Yellow
for ii=8:1:13
for jj=1:1:w
if grid(ii,jj,3)==255
grid(ii,jj,3) = 0;
end
end
end
for ii=w-7:-1:w-12
for jj=1:1:w
if grid(ii,jj,3)==255
grid(ii,jj,3) = 0;
end
end
end
for jj=8:1:13
for ii=1:1:w
if grid(ii,jj,3)==255
grid(ii,jj,3) = 0;
end
end
end
for jj=w-7:-1:w-12
for ii=1:1:w
if grid(ii,jj,3)==255
grid(ii,jj,3) = 0;
end
end
end
imshow(grid)