Hi,
I am looking for a way to add a line to a convex function based on the coordinates.
I have a convex funtion going from x=1, y=19.99 to x=17, y=18.57. How is it possible to draw a straigt line between those two coordinates?
Thank you very much for the help!

 채택된 답변

Siam
Siam 2014년 11월 17일

1 개 추천

You can try this to draw the line
x = [1 17];
y= [19.99 18.57];
line(x,y,'Color','r','LineWidth',4)
You can change the color as 'r' is for red and line width as well which is 4 for this case.

댓글 수: 4

Locks
Locks 2014년 11월 17일
exactly what I was looking for, thanks!
Is it possible to add a circle at the starting and end Point of the line and in the middle?
Siam
Siam 2014년 11월 17일
편집: Siam 2014년 11월 17일
Do you mean straight line will act as the diameter for the circle?
Locks
Locks 2014년 11월 17일
Just a small cicle at the beginning and the end of each line, as i tried to do it manually on the Picture. In Addition, also one in the middle, I'd like to Show that for a convex function the straight line is above the curved one.
Siam
Siam 2014년 11월 17일
Please open a new question and provide some more information with a demo image if possible.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Geometric Transformation and Image Registration에 대해 자세히 알아보기

제품

질문:

2014년 11월 17일

댓글:

2014년 11월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by