function gdisplay(p)

% gdisplay - displays a grey scale image.
% version 2
% Lance Williams 
% Dept. of Computer Science
% Univ. of New Mexico
%

pmin=min(min(p));
pmax=max(max(p));

if matlab
  colormap(gray(255));
  image(((p-pmin)/(pmax-pmin))*255);
else
  imshow(((p-pmin)/(pmax-pmin))*255,gray(255));
end