?? dplot.m
字號:
function dplot(dataX, dataY);% It works similar to stem, but uses a triangle as the marker.% Also uses the dotted-line option for the stem part.%%%%%%%%%%%%%%%%%%%% dplot.m %%%%%%%%%%%%%%%%%%%%% Discrete-Time Control Problems using %% MATLAB and the Control System Toolbox %% by J.H. Chow, D.K. Frederick, & N.W. Chbat %% Brooks/Cole Publishing Company %% September 2002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%if (nargin > 2) | (nargin == 0) error('The input variables are not correct');endif nargin == 1 id = 1:length(dataX); pos_id = find(dataX>=0); id(pos_id) = []; neg_id = id; if ~isempty(pos_id) stem(pos_id, dataX(pos_id), 'filled'); ho = findobj(gca, 'marker', 'o'); set(ho, 'marker', '^'); hold; end if ~isempty(neg_id) stem(neg_id, dataX(neg_id), 'filled'); ho = findobj(gca, 'marker', 'o'); set(ho, 'marker', 'v'); end line([1 length(dataX)], [0 0]);else id = 1:length(dataX); pos_id = find(dataY>=0); id(pos_id) = []; neg_id = id; if ~isempty(pos_id) stem(dataX(pos_id), dataY(pos_id), ':','filled'); ho = findobj(gca, 'marker', 'o'); set(ho, 'marker', '^'); hold; end if ~isempty(neg_id) stem(dataX(neg_id), dataY(neg_id),':','filled'); ho = findobj(gca, 'marker', 'o'); set(ho, 'marker', 'v'); end line([min(dataX) max(dataX)], [0 0]);endhold off;%%%%%%%%%%
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -