?? plotcs.m
字號:
function nt= plotcs(t,c,i,j,samescale)
% The function PLOTCS makes subplots, from I-th to J-th component,
% of the data c(n,k), where n is the number of data points and
% k is the number of IMF components.
% The number of subplots in vertical direction is equal to j-i+1.
% X-axis range is defined as [min(t(1),t(tn)),max(t(1),t(tn))].
%
% Calling sequence-
% nt=plotcs(t,c,i,j,samescale)
%
% Input-
% t - vector t(n) representing the
% time scale values
% c - component data array
% i - index of the first plotted component
% j - index of the last plotted component
% samescale - = 1 if you want all components on the same scale
% Output-
% nt - the handle of the figure
% Steven R.Long (NASA GSFC/WFF) 04 June 2003 Initial
% Kenneth C.Arnold (NASA GSFC) 31 July 2003 Modified
% (added samescale)
% Kenneth C.Arnold (NASA GSFC) 19.Jan. 2004 Modified
% (made i, j optional)
% Kenneth C.Arnold (NASA GSFC) 20.Jan. 2004 Modified
% (reversed c and delt)
% Jelena Marshak (NASA GSFC) 24 Apr. 2004 Modified
% (assigned the handle,
% commented reversed case,
% improved X-axis presentation)
% handle default parameters
if nargin < 3
i = [];
end
if nargin < 4
j = [];
end
if nargin < 5
samescale=0;
end
if isempty(i)
i = 1;
end
if isempty(j)
j = min(size(c));
end
[rows,cols] = size(c) ; % Get Data Size, Shape
%if rows < cols ; % Set Orientation
% c = c' ; % Make Column Data
%end ;
%numpts = max(size(c)) ; % Get Number of Data Pts.
numpts=rows;
numplots = j - i + 1 ; % Set Number of Plots
subplot(numplots,1,1) ; % Set Plotting Area
t1=min(t(1),t(numpts)) ; % Axis Min.
t2=max(t(1),t(numpts)) ; % Axis Max.
if samescale
cmax=max(max(c));
cmin=min(min(c));
end
stop=j;
if(stop>cols)
stop=cols; % Restrict number of plots
end
for jj=i:stop; % Plotting Loop
subplot(numplots,1,jj+1-i) ;
plot(t,c(:,jj));
% if jj ~= j ; % All But Last Plot
if samescale
axis([t1 t2 cmin cmax]);
else
axis([t1 t2 min(c(:,jj)) max(c(:,jj))]);
end
% end ;
s1='c' ;
s2=[s1 num2str(jj)] ;
ylabel(s2) ;
end ;
subplot(numplots,1,1) ;
title('Components') ;
nt=1;
return ;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -