MATLAB: Is there any egde linking/edge following method in matlab

image processing

Dear all, is there any already implemented method for edge linking/edge following to connect the small edge segment of an image in MATLAB.
Thanks in advance.