function vismat(A, B)

if nargin < 2
    A(end, end) = 0;
    A = log10(abs(A)+eps);
    T = [A,zeros(size(A,1),1);zeros(1,size(A,2)+1)];
    pcolor(T);
    shading flat;
    colorbar;
    colormap(jet);
    axis('ij');

else
    C = max(max(max(abs(A))), max(max(abs(B))));

    figure()
    A(end-1, end) = C;
    A(end, end) = 0;
    A = log10(abs(A)+eps);
    T = [A,zeros(size(A,1),1);zeros(1,size(A,2)+1)];
    pcolor(T);
    shading flat;
    colorbar;
    colormap(jet);
    axis('ij');

    figure()
    B(end-1, end) = C;
    B(end, end) = 0;
    B = log10(abs(B)+eps);
    T = [B,zeros(size(B,1),1);zeros(1,size(B,2)+1)];
    pcolor(T);
    shading flat;
    colorbar;
    colormap(jet);
    axis('ij');
    
end
