⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 img.m

📁 一种新的时频分析方法的matlab源程序。
💻 M
字号:
function  img(t,f,nt,ampl_max,ampl_min)
 
% The function IMG draws an image of the 2-D data nt(n,k), where
% n is a number of x-axis points and k is a number of y-axis points,
% using IMAGESC with y-axis set to normal
% (tick values going from minimum to maximum).
% First 3 arguments are required, two others are set by default
% to be equal to max and min values of input data.
%
% Calling sequence-
% img(t,f,nt[,ampl_max][,ampl_min])
%
% Input-
%	nt	        - 2-D matrix nt(n,k)
%	t	        - vector t(k) that specifies the x-axis values
%	f	        - vector f(n) that specifies the y-axis values
%	ampl_max	- max value of the amplitude
%               	if not supplied than the default value
%               	equal to max value of input data is chosen
%	ampl_max	- min value of the amplitude
%               	if not supplied than the default value
%               	equal to min value of input data is chosen
% Example-
% t,f,nt can be generated by nsp():
% [h,xs,w] = nsp(lod78_p',200,1,3224); img(xs,w,h);

% J. Marshak (NASA GSFC)    June 1, 2004 Modified
%                           (added color bar range option)  


if nargin < 4
    ampl_max=[];
end
if nargin < 5
    ampl_min=[];
end
[n,k]=size(nt);

if ~isempty(ampl_max)
for j1=1:n
   for i1=1:k
      if (nt(j1,i1)> ampl_max);
          nt(j1,i1)=ampl_max;
      end
   end
end
end

if ~isempty(ampl_min)
for j1=1:n
   for i1=1:k
      if (nt(j1,i1)< ampl_min);
          nt(j1,i1)=ampl_min;
      end
   end
end
end

g=imagesc(t,f,nt);
set(gca,'tickdir','out');
h=get(g,'Parent');
set(h,'Ydir','normal');

⌨️ 快捷键说明

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