function SynapticDisplay(layer)


    global EFR EFRDATA NLAYERS NET_SIZE SQNET_SIZE N_FILES N_GROUPS N_VIEWS N_LOCS BESTCELLS NBESTCELLS NBESTCELLSINFORM NTRANSFORMS XY_VIEW ...
        PARAMETER_LIST SYNMAT SYNMAT_CHANGE SYNMAT_CHANGE_GROUP LOGNUM FIXEDTRACE SPARSENESS ETA LRNRATE ...
        NSYN SYNMATL1 SYNMATL2 SYNMATL3 SYNMATL4 VNLOGINDEX IMLIST IMLIST_TEST N_VIEWS_TEST FILTIM NSYNL1 Images ...
        base_dir image_dir FiltImSize SqFiltImSize Display HEADDIR APLACE EYEPOS;

    figure(layer * 10 + 8);
    
    if layer == 1
        SynMatDisp = zeros(NSYN(layer), SQNET_SIZE);
        for i = 1 : SQNET_SIZE
            synapseIndex = find(SYNMATL1(:,i));
            NeuronSynWeights = SYNMATL1(synapseIndex, i);
            SynMatDisp(:, i) = NeuronSynWeights;
        end
%         size(SynMatDisp)
%         
%         SynMatDisp = full(SYNMATL1);
%         size(SynMatDisp)
                
    elseif layer == 2
        SynMatDisp = zeros(NSYN(layer), SQNET_SIZE);
        for i = 1 : SQNET_SIZE
            synapseIndex = find(SYNMATL2(:,i));
            NeuronSynWeights = SYNMATL2(synapseIndex, i);
            SynMatDisp(:, i) = NeuronSynWeights;
        end
        
        %SynMatDisp = full(SYNMATL2);
    elseif layer == 3
        SynMatDisp = full(SYNMATL3);
    elseif layer == 4
        SynMatDisp = full(SYNMATL4);
    end
     
        
    %size(SynMatDisp)
    imagesc(SynMatDisp);
    %colormap(jet);
    colormap(gray(256));
    title([' Synaptic Matrix layer ', num2str(layer)]);
    colorbar;
    %disp(['RetPos=', num2str(RetPos), '  EyePos=', num2str(EyePos), '  HeadCoord=', num2str(HeadCoord)]);
    drawnow
    fprintf('Layer=%3d Min synaptic value=%3.2f Max=%3.2f\n', layer, min(min(SynMatDisp)), max(max(SynMatDisp)));
end
