This paper presents a MATLAB implementation of the material-field series-expansion (MFSE) topo-logy optimization method. The MFSE method uses a bounded material field with specified spatial correlation to represent the structural topology. With the series-expansion method for bounded fields, this material field is described with the characteristic base functions and the corresponding coefficients. Compared with the conventional density-based method, the MFSE method decouples the topological description and the finite element discretization, and greatly reduces the number of design variables after dimensionality reduction. Other features of this method include inherent control on structural topological complexity, crisp structural boundary description, mesh independence, and being free from the checkerboard pattern. With the focus on the implementation of the MFSE method, the present MATLAB code uses the maximum stiffness optimization problems solved with a gradient-based optimizer as examples. The MATLAB code consists of three parts, namely, the main program and two subroutines (one for aggregating the optimization constraints and the other about the method of moving asymptotes optimizer). The implementation of the code and its extensions to topology optimization problems with multiple load cases and passive elements are discussed in detail. The code is intended for researchers who are interested in this method and want to get started with it quickly. It can also be used as a basis for handling complex engineering optimization problems by combining the MFSE topology optimization method with non-gradient optimization algorithms without sensitivity information because only a few design variables are required to describe relatively complex structural topology and smooth structural boundaries using the MFSE method.