Based on the combination of wavelet transform and mathematical morphology, a novel approach for the edge detection is prepared in this paper. First, detect the image edge with multi-scale adaptive wavelet threshold method, and select proper structure element for dilation operation according to the types of mathematical morphology and process the discontinuous edge. This is a Edge Detection Matlab code.