show.m

来自「x=2*sin(4*pi*t)+5*cos(8*pi*t) 对其进行快速傅立叶变」· M 代码 · 共 39 行

M
39
字号
function show(x,sc)

%   SHOW   Display an image.    
%	
%	   SHOW(X,SC) display the matrix in X as an image, scaling 
%          it to achieve the maximum color resolution. SC is an 
%          optional brightening factor.
%
%          If SC is not given or equal to 1, the dynamic range will
%          be fit into 0-63 (the size of the built in colormaps).
%          If it is set to another value, this range will be 
%          multiplied by SC. A negative value will invert the image 
%          colors.
%
%          Good B&W views can be obtained if the gray or pink 
%          colormap is set.
%
%          See also: BANDADJ, COLORMAP, IMAGE.


%--------------------------------------------------------
%       (c) Copyright 1994, by Universidad de Vigo
%           under GNU conditions. 
%       Author: Sergio J. Garcia Galan
%       e-mail: Uvi_Wave@tsc.uvigo.es
%--------------------------------------------------------


if nargin==1
	sc=1;
end
if sc<0,
	sc=-sc;
	x=-x;
end
M=max(max(x));
m=min(min(x));
image((x-m)*64/(M-m)*sc);

⌨️ 快捷键说明

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