How do i plot a line at a single desired point on the X-Axis?

조회 수: 2 (최근 30일)
Parth Sarathi
Parth Sarathi 2016년 4월 10일
답변: Kuifeng 2016년 4월 10일
I have a data i.e. x=[1:10]; y=[23 24 29 45 32 23 67 45 89 31]; and i want to draw a line on the x-axis at point 6 of x-axis. How can i do that? Thanks, Parth
  댓글 수: 1
Walter Roberson
Walter Roberson 2016년 4월 10일
Where should the line start? Where should it end? Is it a horizontal line or a vertical line?

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

답변 (1개)

Kuifeng
Kuifeng 2016년 4월 10일
%at point x0 = 6, vertical line
x0 = 6;
plot([x0 x0], [min(y), max(y)], 'r-');
%revise the y values to your desired values

카테고리

Help CenterFile Exchange에서 Pole and Zero Locations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by