function plottime(X,n) % plottime --> Plot discrete time signals. % % % plottime(X) % plottime(X,n) % % % Plot matrix of discrete time signals versus sample index n. % % % plotstem --> Plot sample values of discrete time signals. % % Peter S.K. Hansen, IMM, Technical University of Denmark % % Last revised: February 7, 2000 %----------------------------------------------------------------------- % Check the required input arguments. if (nargin < 1) error('Not enough input arguments.') elseif (nargin==1) n = 1:max(size(X)); end set(gcf,'DefaultAxesFontName','Times', ... 'DefaultAxesLineStyleOrder','-|--|-.|:'); plot(n,X); x_min = min(min(X)); if (x_min>0) x_min = 0.9*x_min; else x_min = 1.1*x_min; end x_max = max(max(X)); if (x_max>0) x_max = 1.1*x_max; else x_max = 0.9*x_max; end if (n(1)==0) axis([n(1) n(length(n))+1 x_min x_max]); else axis([n(1)-1 n(length(n))+1 x_min x_max]); end xlabel('Sample Number, {\it n}'); ylabel('Amplitude'); %----------------------------------------------------------------------- % End of function plottime %-----------------------------------------------------------------------