File Exchange

image thumbnail

Get points for a line between 2 points

version 1.0.0.0 (1.21 KB) by shaz
You have 2 points, and you want N number of points between these 2 points.

3 Downloads

Updated 21 Oct 2010

View License

You have 2 points, and you want N number of points between these 2 points. It's like making a line between 2 points. It takes start and end points, and the number of points you want in between.

Cite As

shaz (2021). Get points for a line between 2 points (https://www.mathworks.com/matlabcentral/fileexchange/29104-get-points-for-a-line-between-2-points), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)

Suinn Park

In the source code,

if m == Inf "|| m == -Inf"

I think the latter condition (in quotation mark) is required for some case. Thanks!

Michael Chan

Thank you, it is useful in certain applications.

Sean de

This is basically just a wrapper for LINSPACE that does a whole bunch of unnecessary computations. It doesn't matter what the slope, m, is for this computation and it is computed and used to vary how LINSPACE is called. LINSPACE can be called with the same start and end point with a number of divisions and it will be the same as just replicating that number. The author didn't recognize this.

-Anything with four lower case Ls in a row is confusing.
-There is no help, no H1 line

I would also think that for something like this to be useful, it should work in nD space. I.e. start point and end point could be vectors of any dimension and it would output that many vectors corresponding to the line through n dimensions.

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories

Community Treasure Hunt

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

Start Hunting!