File Exchange

image thumbnail

Line Intersect

version (919 Bytes) by Jonathan Millin
Finds the points of intersection for linear time series data, very efficiently

1 Download

Updated 21 Apr 2008

No License

Finds the intersection point for a set of time series data, without any loops.

Elapsed time is 0.000212 seconds, searching 1800 points, and finding 90 intersections, on a Core 2 Duo E6600 :)

Example Code::

numElem= 50;

[x,y, signs]=lineIntersect(a,b);

Cite As

Jonathan Millin (2020). Line Intersect (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

w s

There is a similar file on the FEX

In how far does your file differ from this one?

Jos x@y.z

It errors and produces wrong results for certain inputs. I hope you can either fix this or check for such (quite normal) inputs.

>> Lineintersect([0 1 2 4],[2 1 2 3 ])
??? Error using ==> vertcat
All rows in the bracketed expression must have the same
number of columns.

>> Lineintersect([0 1 2 4].',[2 1 2 3 ].')
Warning: Divide by zero.
> In lineIntersect at 44
ans = NaN

I will not rate this for now (2-star), because I think the authors can solve this. While they are at it, I hope they also modify the help section considerably, including a H1 line, adding detailed description of input and output parameters.

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