You can create a vector with many identical values for x. Something like this:
x = 5*ones(1,100);
y = 1:100;
plot(x,y)
or use the line function:
line([5,5],[0,10])
To automatically detect the range of line, use ylim:
plot(1:10)
line([5,5],ylim)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…