An activated sludge floc analysis method based on an MATLAB comprises the following steps that 1, images are collected; 2, the images are processed, wherein the collected images are read in, the RGB images are converted into gray level images, noise is removed, image binaryzation is carried out, open operation and closed operation are carried out, edge smoothing treatment is carried out, a target zoogloea is determined and marked, filling is carried out, target area grey-scale maps are drawn, the sum of the grey levels of the target area grey-scale maps is calculated, the area of a target area is calculated, the density of the target area is calculated, and the boundary of the target area is acquired; 3, feature information is extracted, wherein the dimensional index of the zoogloea is calculated, the morphological index of the zoogloea is calculated, and the filamentous bacterium index is calculated. According to the method, MATLAB analysis software is adopted as a platform, the image analysis technology is applied to quantitative analysis of activated sludge floc, and the objectivity, reliability and high efficiency of the analysis result are guaranteed.