vline.m

来自「偏最小二乘算法在MATLAB中的实现」· M 代码 · 共 19 行

M
19
字号
function vline(x,lt)
%HLINE Adds a vertical line to current graph at specified location
%  The inputs are the location of the line, x and an optional variable
%  lt, which specifies the line color and type. The default is a solid
%  green line.
%  I/O syntax is: vline(x,lt)  Note that lt is a text string, e.g. 
%  enter as:  vline(25,'--c') for a dashed cyan line at 25.
z = axis;
i = ishold;
hold on
if nargin == 1
  plot([x x],[z(3) z(4)],'-g')
else
  plot([x x],[z(3) z(4)],lt)
end
if i == 0
  hold off
end

⌨️ 快捷键说明

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