필터 지우기
필터 지우기

create a line between two points on an already made plot

조회 수: 6 (최근 30일)
Dimitris Arapidis
Dimitris Arapidis 2013년 9월 5일
답변: Abhishekkumar Shingala 2020년 12월 29일
I have matrices x and y and make a plot with them. x=[0,...,85.8024]; (100 numbers) y=[0.8736,...,1.2157];(100 numbers) figure plot(x,y)
i want to create a line from A=(0,0.8736) to B=(85.8024,1.2157) on the same plot (red color).

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 9월 5일
add
hold on
plot([0 85.8024],[0.8736 1.2157],'r')
  댓글 수: 2
Adam Fitchett
Adam Fitchett 2019년 10월 23일
편집: Adam Fitchett 2019년 10월 23일
Hi, I know this is a long time after the reply was written, but...
I tried this method and it drew the line between the two points, but after the second point the line veers at a seemingly random angle and then goes off into the distance. How do you draw the line so that it is just between the two points and doesn’t carry on after?

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

추가 답변 (1개)

Abhishekkumar Shingala
Abhishekkumar Shingala 2020년 12월 29일
Can we create smooth line (curve) between two points?

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by