Adding vertical line to graph
2 ビュー (過去 30 日間)
古いコメントを表示
ferdaous abderrazak
2019 年 1 月 3 日
コメント済み: ferdaous abderrazak
2019 年 1 月 3 日
Hello,
I'm trying to present a vertical line to my graph as you can see below but I don't get the curve of the vetical line

0 件のコメント
採用された回答
Cris LaPierre
2019 年 1 月 3 日
編集済み: Cris LaPierre
2019 年 1 月 3 日
xline(x1)
Otherwise, what happens if you use the plot function instead of line?
plot([x1 x1],[y0 y1])
2 件のコメント
Cris LaPierre
2019 年 1 月 3 日
編集済み: Cris LaPierre
2019 年 1 月 3 日
Never mind. I see what you are doing.
You plot your line using frequency(k) for x, but everything else is plotted using frequency(k)/1e9 for x. Your line is being plotted waaaayyyy off to the right.
You also set the limits of your X axis using the axis function to frequency/1e9.
Your lines are there, but you've clipped them off. Try
x1 = x1/1e9;
line([x1 x1],[y0 y1])
or comment out the line of code containing the axis command. This will make it more obvious what is happening.
その他の回答 (1 件)
madhan ravi
2019 年 1 月 3 日
編集済み: madhan ravi
2019 年 1 月 3 日
Save the variable in each iteration and plot it outside the loop , you seem to be overwriting them so finally you try to plot a point . Upload your code if you are not able to figure it out.
参考
カテゴリ
Help Center および File Exchange で Line Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!