Draw a line

조회 수: 47 (최근 30일)
Vibol TEAV
Vibol TEAV 2011년 6월 5일
답변: Steven Lord 2022년 11월 7일
I'm new to Matlab, I wanna draw a simple line x=4, or y=9. Someone kindly help me?

채택된 답변

Matt Fig
Matt Fig 2011년 6월 5일
line([4 4],[0 10],'color','b') % Blue line from (4,0) to (4,10)
line([0 10],[9 9],'color','r') % Red line from (0,9) to (10,9)
axis([0 10 0 10]) % Set the axis limits
You can do the same thing with the PLOT command.
  댓글 수: 1
Vibol TEAV
Vibol TEAV 2011년 6월 5일
Great, this is what I'm looking for. Thanks a million!!!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Steven Lord
Steven Lord 2022년 11월 7일
If you're using release R2018b or later you can use the xline or yline functions.

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by