Find coordinates at the midpoint of a line.

I can plot a line between points (so I know the x and y's of the endpoints). I also know this can give the distance between the points. I'm sure there is a oneline command to calculate the midpoint coordinates. Any help would be appreciated. Thankyou.

More Answers (1)

line=[x1 y1;x2 y2]
line=[0 0;10 50];
mid_pt=mean(line)
mid_pt = 1×2
5 25

Categories

Find more on Numerical Integration and Differential Equations in Help Center and File Exchange

Asked:

on 27 Nov 2011

Answered:

on 19 Jan 2023

Community Treasure Hunt

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

Start Hunting!