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 :)
Jonathan Millin (2020). Line Intersect (https://www.mathworks.com/matlabcentral/fileexchange/19642-line-intersect), MATLAB Central File Exchange. Retrieved .
There is a similar file on the FEX
In how far does your file differ from this one?
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.