% Randy Dimmett
% Semester Project
% Image to Black and White Conversion:

Img1 = imread('a.bmp');
BW = im2bw(Img1,.5);
[MaxRows,MaxCols]=size(BW);
BWLength=MaxRows*MaxCols;
A=BW(1:BWLength);
Img1 = imread('b.bmp');
BW = im2bw(Img1,.5);
B=BW(1:BWLength);
Img1 = imread('c.bmp');
BW = im2bw(Img1,.5);
C=BW(1:BWLength);
Img1 = imread('d.bmp');
BW = im2bw(Img1,.5);
D=BW(1:BWLength);
Img1 = imread('e.bmp');
BW = im2bw(Img1,.5);
E=BW(1:BWLength);
Img1 = imread('f.bmp');
BW = im2bw(Img1,.5);
F=BW(1:BWLength);
Img1 = imread('g.bmp');
BW = im2bw(Img1,.5);
G=BW(1:BWLength);
Img1 = imread('h.bmp');
BW = im2bw(Img1,.5);
H=BW(1:BWLength);
Img1 = imread('i.bmp');
BW = im2bw(Img1,.5);
I=BW(1:BWLength);
Img1 = imread('j.bmp');
BW = im2bw(Img1,.5);
J=BW(1:BWLength);
Img1 = imread('k.bmp');
BW = im2bw(Img1,.5);
K=BW(1:BWLength);
Img1 = imread('l.bmp');
BW = im2bw(Img1,.5);
L=BW(1:BWLength);
Img1 = imread('m.bmp');
BW = im2bw(Img1,.5);
M=BW(1:BWLength);
Img1 = imread('n.bmp');
BW = im2bw(Img1,.5);
N=BW(1:BWLength);
Img1 = imread('o.bmp');
BW = im2bw(Img1,.5);
O=BW(1:BWLength);
Img1 = imread('p.bmp');
BW = im2bw(Img1,.5);
P=BW(1:BWLength);
Img1 = imread('q.bmp');
BW = im2bw(Img1,.5);
Q=BW(1:BWLength);
Img1 = imread('r.bmp');
BW = im2bw(Img1,.5);
R=BW(1:BWLength);
Img1 = imread('s.bmp');
BW = im2bw(Img1,.5);
S=BW(1:BWLength);
Img1 = imread('t.bmp');
BW = im2bw(Img1,.5);
T=BW(1:BWLength);
Img1 = imread('u.bmp');
BW = im2bw(Img1,.5);
U=BW(1:BWLength);
Img1 = imread('v.bmp');
BW = im2bw(Img1,.5);
V=BW(1:BWLength);
Img1 = imread('w.bmp');
BW = im2bw(Img1,.5);
W=BW(1:BWLength);
Img1 = imread('x.bmp');
BW = im2bw(Img1,.5);
X=BW(1:BWLength);
Img1 = imread('y.bmp');
BW = im2bw(Img1,.5);
Y=BW(1:BWLength);
Img1 = imread('z.bmp');
BW = im2bw(Img1,.5);
Z=BW(1:BWLength);
Img1 = imread('space.bmp');
BW = im2bw(Img1,.5);
Spacer=BW(1:BWLength);

fid = fopen('projectdata.m','w');
 fprintf(fid,'A= [');
for i=1:length(A)
 fprintf(fid,'%d ',double(A(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TA=[ 0; 0; 0; 0; 1 ];\n');
 fprintf(fid,'B= [');
for i=1:length(B)
 fprintf(fid,'%d ',double(B(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TB=[ 0; 0; 0; 1; 0 ];\n');
 fprintf(fid,'C= [');
for i=1:length(C)
 fprintf(fid,'%d ',double(C(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TC=[ 0; 0; 0; 1; 1 ];\n');
 fprintf(fid,'D= [');
for i=1:length(D)
 fprintf(fid,'%d ',double(D(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TD=[ 0; 0; 1; 0; 0 ];\n');
 fprintf(fid,'D= [');
for i=1:length(D)
 fprintf(fid,'%d ',double(D(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TE=[ 0; 0; 1; 0; 1 ];\n');
 fprintf(fid,'E= [');
for i=1:length(E)
 fprintf(fid,'%d ',double(E(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TF=[ 0; 0; 1; 1; 0 ];\n');
 fprintf(fid,'F= [');
for i=1:length(F)
 fprintf(fid,'%d ',double(F(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TG=[ 0; 0; 1; 1; 1 ];\n');
 fprintf(fid,'G= [');
for i=1:length(G)
 fprintf(fid,'%d ',double(G(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TH=[ 0; 1; 0; 0; 0 ];\n');
 fprintf(fid,'H= [');
for i=1:length(H)
 fprintf(fid,'%d ',double(H(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TI=[ 0; 1; 0; 0; 1 ];\n');
 fprintf(fid,'I= [');
for i=1:length(I)
 fprintf(fid,'%d ',double(I(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TJ=[ 0; 1; 0; 1; 0 ];\n');
 fprintf(fid,'J= [');
for i=1:length(J)
 fprintf(fid,'%d ',double(J(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TK=[ 0; 1; 0; 1; 1 ];\n');
 fprintf(fid,'K= [');
for i=1:length(K)
 fprintf(fid,'%d ',double(K(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TL=[ 0; 1; 1; 0; 0 ];\n');
 fprintf(fid,'L= [');
for i=1:length(L)
 fprintf(fid,'%d ',double(L(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TM=[ 0; 1; 1; 0; 1 ];\n');
 fprintf(fid,'M= [');
for i=1:length(M)
 fprintf(fid,'%d ',double(M(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TN=[ 0; 1; 1; 1; 0 ];\n');
 fprintf(fid,'N= [');
for i=1:length(N)
 fprintf(fid,'%d ',double(N(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TO=[ 0; 1; 1; 1; 1 ];\n');
 fprintf(fid,'O= [');
for i=1:length(O)
 fprintf(fid,'%d ',double(O(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TP=[ 1; 0; 0; 0; 0 ];\n');
 fprintf(fid,'P= [');
for i=1:length(P)
 fprintf(fid,'%d ',double(P(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TQ=[ 1; 0; 0; 0; 1 ];\n');
 fprintf(fid,'Q= [');
for i=1:length(Q)
 fprintf(fid,'%d ',double(Q(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TR=[ 1; 0; 0; 1; 0 ];\n');
 fprintf(fid,'R= [');
for i=1:length(R)
 fprintf(fid,'%d ',double(R(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TS=[ 1; 0; 0; 1; 1 ];\n');
 fprintf(fid,'S= [');
for i=1:length(S)
 fprintf(fid,'%d ',double(S(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TT=[ 1; 0; 1; 0; 0 ];\n');
 fprintf(fid,'T= [');
for i=1:length(T)
 fprintf(fid,'%d ',double(T(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TU=[ 1; 0; 1; 0; 1 ];\n');
 fprintf(fid,'U= [');
for i=1:length(U)
 fprintf(fid,'%d ',double(U(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TV=[ 1; 0; 1; 1; 0 ];\n');
 fprintf(fid,'V= [');
for i=1:length(V)
 fprintf(fid,'%d ',double(V(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TW=[ 1; 0; 1; 1; 1 ];\n');
 fprintf(fid,'W= [');
for i=1:length(W)
 fprintf(fid,'%d ',double(W(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TX=[ 1; 1; 0; 0; 0 ];\n');
 fprintf(fid,'X= [');
for i=1:length(X)
 fprintf(fid,'%d ',double(X(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TY=[ 1; 1; 0; 0; 1 ];\n');
 fprintf(fid,'Y= [');
for i=1:length(Y)
 fprintf(fid,'%d ',double(Y(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'TZ=[ 1; 1; 0; 1; 0 ];\n');
 fprintf(fid,'Z= [');
for i=1:length(Z)
 fprintf(fid,'%d ',double(Z(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'Tspacer=[ 1; 1; 0; 1; 1 ];\n');
 fprintf(fid,'Spacer= [');
for i=1:length(Spacer)
 fprintf(fid,'%d ',double(Spacer(i)));
end;
 fprintf(fid,'];\n');
 fprintf(fid,'targets=[TA TB TC TD TE TF TG TH TI TJ TK TL TM TN TO TP TQ TR TS TT TU TV TW TX TY TZ Tspacer];\n');
 fprintf(fid,'inputs=[A; B; C; D; E; F; G; H; I; J; K; L; M; N; O; P; Q; R; S; T; U; V; W; X; Y; Z; Spacer];\n');
 fclose(fid);
 