?? img.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 + -