How to devide a line passing through two points into equal segments?
Ältere Kommentare anzeigen
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?
Akzeptierte Antwort
Weitere Antworten (1)
dpb
am 21 Jul. 2016
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.
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
