Caution: The signatures of the Python and MATLAB functions change in PDFO 2.0. Check the changelog.

Installation for MATLAB#


PDFO supports MATLAB R2014a and later releases. To use the MATLAB version of PDFO, you need first to configure the MEX of your MATLAB so that it can compile Fortran. To check whether your MEX is ready, run the following code in MATLAB

mex('-v', '-setup', 'Fortran'); mex('-v', fullfile(matlabroot, 'extern', 'examples', 'refbook', 'timestwo.F')); timestwo(1); delete('timestwo.mex*');

It will attempt to set up your MEX and then compile an example provided by MathWorks for testing MEX on Fortran. If this completes successfully, then your MEX is ready. Otherwise, it is not, and you may try equipez/setup_mex. It will help you to set MEX up on Windows or macOS (the setup of MEX is trivial on Linux). In case setup_mex does not work, you need to consult a local MATLAB expert or the technical support of MathWorks about “how to set up MEX,” which is not part of PDFO.


Download and decompress the source code package. You will obtain a folder containing setup.m. Place this folder at the location where you want PDFO to be installed. In MATLAB, change the directory to this folder, and execute


If this command runs successfully, PDFO is installed. You may execute the following command in MATLAB to verify the installation