MATLAB CODE FOR PRINTING TRAINING PATTERNS

                                                                                      
BACK TO HOME PAGE
LOOK AT OUTPUT
                                                                                       
BACK TO MATLAB CODE
                                                                                      
                                                                                       
BACK TO PROJECT PAGE
function cool3                                                                   
figure
tp=[0 0 1 1 1 1 1;0 1 0 0 0 0 1;1 0 0 0 0 0 0;1 0 0 0 0 0 0;1 0 0 0 0 0 0;1 0 0 0 0 0 0;1 0 0 0 0 0 0;0 1 0 0 0 0 1;0 0 1 1 1 1 0];
for i=1:9
    for j=1:7;
        if tp(i,j)= =1
            x=j;
            y=-i;
            hold on;
            subplot(3,7,1),plot(x,y,'k.');
        end
end
end

title('Training Pattern');




a=[0 0 1 1 0 0 0; 0 0 0 1 0 0 0;0 0 0 1 0 0 0 ; 0 0 1 0 1 0 0; 0 0 1 0 1 0 0 ; 0 1 1 1 1 1 0; 0 1 0 0 0 1 0; 0 1 0 0 0 1 0; 1 1 1 0 1 1 1];

for i=1:9
    for j=1:7;
        if a(i,j)= =1
            x=j;
            y=-i;
            hold on;
            subplot (3 ,7 , 5); plot(x,y,'k.');
        end
end
end

b1=[1 1 1 1 1 1 0;0 1 0 0 0 0 1;0 1 0 0 0 0 1; 0 1 0 0 0 0 1; 0 1 1 1 1 1 0; 0 1 0 0 0 0 1; 0 1 0 0 0 0 1; 0 1 0 0 0 1 0; 1 1 1 1 1 1 0];
for i=1:9
    for j= 1:7;
        if b1(i,j)==1
            x=j;
            y=-i;
            hold on;
            subplot(3 , 7, 12), plot(x,y,'k.');
        end
end
end

c1=[0 0 1 1 1 1 1 ; 0 1 0 0 0 0 1; 1 0 0 0 0 0 0 ; 1 0 0 0 0 0 0 ; 1 0 0 0 0 0 0 ; 1 0 0 0 0 0 0 ; 1 0 0 0 0 0 0; 0 1 0 0 0 0 1; 0 0 1 1 1 1 0];
for i=1:9
    for j=1:7;
        if c1(i,j)==1
            x=j;
            y=-i;
            hold on;
            subplot(3,7,19), plot(x,y,'k.');
        end
end
end

d1=[1 1 1 1 1 0 0 ; 0 1 0 0 0 1 0; 0 1 0 0 0 0 1;0 1 0 0 0 0 1;0 1 0 0 0 0 1;0 1 0 0 0 0 1; 0 1 0 0 0 0 1; 0 1 0 0 0 1 0; 1 1 1 1 1 0 0];
for i=1:9
    for j=1:7;
        if d1(i,j)==1
            x=j;
            y=-i;
            hold on;
            subplot(3,7,20), plot(x,y,'k.');
        end
end
end

e1=[1 1 1 1 1 1 1; 0 1 0 0 0 0 1; 0 1 0 0 0 0 0 ; 0 1 0 1 0 0 0 ;0 1 1 1 0 0 0 ;0 1 0 1 0 0 0 ;0 1 0 0 0 0 0 ; 0 1 0 0 0 0 1; 1 1 1 1 1 1 1];
for i=1:9
    for j=1:7;
        if e1(i,j)==1
            x=j;
            y=-i;
            hold on;
            subplot(3,7,21), plot(x,y,'k.');
        end
end
end
1