function dispmat(mat,str)

[nr,nc] = size(mat);
M = max(max(abs(mat)));
m = min(min(mat));
% os = 125;
os = 0;

if all(all(isreal(mat)))
%     imshow(uint8(255-(os + (255-os)*(mat-m)/(M-m))));
    imagesc(uint8(255-(os + (255-os)*(mat-m)/(M-m))));
    
    axis equal; colormap gray; axis([1 nc 1 nr]);
    if nargin == 1,
        title(['max = ',num2str(M),', min = ',num2str(m)],'FontSize',14);
    else
        title([str,', max = ',num2str(M)],'FontSize',14);
    end
    
else
    mat2 = [(abs(mat)-m)/(M-m),(angle(mat)+pi)/2/pi];
%     imshow(uint8(255-(os + (255-os)*mat2)));
    imagesc(uint8(255-(os + (255-os)*mat2)));
    axis equal; colormap gray; axis([1 nr 1 2*nc]);
    if nargin == 1,
        title(['max = ',num2str(M),', min = ',num2str(m),', abs/angle'],...
            'FontSize',14);
    else
        title([str,', max = ',num2str(M),', abs/angle'],'FontSize',14);
    end
    
    
end
% imshow(uint8((os + (255-os)*mat/M)));

% colormap bone


%     title([str,', max = ',num2str(M),', min = ',num2str(m)]);
    
%     title(str,'FontSize',14)

end
