MATLAB: Find coordinates at the midpoint of a line.

calculate midpoint

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.

Best Answer

[(x1+x2)/2, (y1+y2)/2]