-
2 Comments
Shlomo Geva
on 17 Nov 2020
Nice, but misses an edge case, hence not quite correct. It will enter an infinite recursion loop when the two inputs, s1 and s2, are disjoint (i.e. they do not overlap).
Easy to fix with a check that intersect(s1,s2) is not empty.
加俊
on 29 Jul 2022
good job
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!