📄 dplot.m
字号:
function dplot(x,y,hue)
%DPLOT Plot discrete sequence data.
% DPLOT(Y) plots the data sequence Y as stems from the x-axis.
% DPLOT(X,Y) plots the data sequence Y at the values specfied
% in X.
% There is an optional final string argument to specify a color
% for the stems of the data sequence. E.g. STEM(X,Y,'r') or
% STEM(Y,'g').
%
% See also PLOT, BAR, STAIRS.
%
%
n = length(x);
if nargin == 1
y = x(:)';
x = 1:n;
hue = 'k';
elseif nargin == 2
if isstr(y)
hue = y;
y = x(:)';
x = 1:n;
else
x = x(:)';
y = y(:)';
hue = 'y';
end
elseif nargin == 3
x = x(:)';
y = y(:)';
end
xx = [x;x;nan*ones(size(x))];
yy = [zeros(1,n);y;nan*ones(size(y))];
cax = newplot;
next = lower(get(cax,'NextPlot'));
hold_state = strcmp(next,'add') &
strcmp('add',lower(get(gcf,'NextPlot')));
h = plot(xx(:),yy(:),hue);
v = axis;
v(2) = n+1;
axis(v);
%xlabel('Impulse Response');
xlabel('Time domain');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -