필터 지우기
필터 지우기

Error by using xline function

조회 수: 21 (최근 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 CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by