Error by using xline function

20 ビュー (過去 30 日間)
Chiara Lanzi
Chiara Lanzi 2020 年 11 月 7 日
コメント済み: Star Strider 2021 年 3 月 9 日
Hi everyone,
I ran into a problem by using the xline function.
My aim was to draw a vertical line for x=5 and planned to use the xline function but I got "Undefined function".
I find this strange as the function is on the help suggestions.
Can somebody help me with this issues?
Thankks to all who can help me.
Chiara

採用された回答

Star Strider
Star Strider 2020 年 11 月 7 日
The xline function was introduced in R2018b.
Try this:
figure
plot((0:8), rand(1,9))
hold on
plot([1 1]*5, ylim, '-r') % Draw A Red Vertical Line At ‘x=5’
hold off
.
  4 件のコメント
Rasmus  Johs Nielsen
Rasmus Johs Nielsen 2021 年 3 月 9 日
Is it possible to add text to the line?
Star Strider
Star Strider 2021 年 3 月 9 日
Rasmus Johs Nielsen — Probably. It depends on what you want to do, and where you want to place the text.
See the documentation on text for details.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by