dp.m

来自「PLS_Toolbox是用于故障检测与诊断方面的matlab工具箱」· M 代码 · 共 28 行

M
28
字号
function dp(lc)
%DP draws a diagonal line on an existing figure.
%  DP draws a diagonal line on an existing figure
%  from the bottom left axis to the upper right axis.
%  The optional input variable (lc) can be used to define
%  the line style and color as for normal plotting.
%  For example dp('--b') plots a 45 degree diagonal
%  dash blue line.
%
%I/O: dp(lc);
%
%See Also: PLOT, HLINE, VLINE, ELLPS, HIGHORB, ZOOMPLS

%Copyright Eigenvector Research, Inc. 1996-98

if nargin<1
  lc  = '-g';
end
v     = axis;
axis  = v;
ur = max([v(2) v(4)]);
ll = min([v(1) v(3)]);
if ishold
  plot([ll ur],[ll ur],lc)
else
  hold on, plot([ll ur],[ll ur],lc); hold off
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?