This article presents a highly optimized translation of the core discrete Remez multiple exchange (RME) part of the Parks-McClellan (PM) algorithm from its original FORTRAN code to its MATLAB counterpart. The optimization reduces the CPU execution time and code complexity. For achieving these goals, first, according to a thorough study of the existing FORTRAN code of the PM algorithm, the search in the core part for the ldquorealrdquo extremal points of the weighted error function, which is generated based on the ldquotrialrdquo extremal points, is compressed into only two compact basic search techniques. Secondly, vectors and matrices are used whenever possible due to many fast built-in operations in the MATLAB. Several examples are included to illustrate the superiority of the proposed MATLAB version of the PM algorithm over the existing function firpm, which is mostly based on a direct translation of the original FORTRAN code.