autoimageinv.m

来自「beamlet变化的工具箱」· M 代码 · 共 57 行

M
57
字号
function AutoImage(img,x,y)
% AutoImage -- Image display of object assuming arbitrary values
%  Usage
%    AutoImage(img [,x,y])
%  Inputs
%    img     2-d image
%    x,y     where x and y are vectors, specifies the labeling of
%   	     X- and Y-axes, but produces the same image as AutoImage(img).
%
%  Side Effects
%    The object img, assuming arbitrary values, is scaled to the 
%    range (0,255) and displayed as an image with 256 shades of gray.
%
%  Description
%    If the object is already scaled to the range (0,255) you may
%    use GrayImage.
%
%  See Also
%    GrayImage
%

	mmin = min(min(img));
	mmax = max(max(img));

	if nargin == 1,
		image(256-(256*(img-mmin)/(mmax-mmin)))
	else
		image(x,y,256-(256*(img-mmin)/(mmax-mmin)))
	end

	axis('image')
	colormap(gray(256))
    
    
%   
% Part of WaveLab Version 800
% Built Saturday, February 13, 1999 4:09:39 PM
% This is Copyrighted Material
% For Copying permissions see COPYING.m
% Comments? e-mail wavelab@stat.stanford.edu
%   
    
%% Part of BeamLab Version:200% Built:Friday,23-Aug-2002 00:00:00% This is Copyrighted Material% For Copying permissions see COPYING.m% Comments? e-mail beamlab@stat.stanford.edu%%% Part of BeamLab Version:200% Built:Saturday,14-Sep-2002 00:00:00% This is Copyrighted Material% For Copying permissions see COPYING.m% Comments? e-mail beamlab@stat.stanford.edu%

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?