How to devide a line passing through two points into equal segments?
显示 更早的评论
Hello, I have two points: (x1,y1) and (x2,y2). Now I want to devide the line passing through these two points into 'n' equal segments. Unfortunately the 'linspace' can just be applied to horizontal and vertical lines! Does anybody have an idea?
采纳的回答
更多回答(1 个)
dpb
2016-7-21
For straight line it doesn't matter; just divide dx, dy by the number of intervals.
xpts=linspace(x(1),x(end),N);
ditto for y.
类别
在 帮助中心 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
