Simply download the project files and run INSTALL_Direct_Method_Examples.m. Then you can use Run_All_Examples.m to run each method.
Please see the README at: https://github.com/danielrherber/optimal-control-direct-method-examples
I can not run INSTALL_Direct_Method_Examples.m.
As "INSTALL_DTQP_Project has not been defined."
Thank you for your comment and rating chou fly.
You are correct that those files are not directly included in this submission, but they will be automatically downloaded from MFX 51104 if you run the install file (INSTALL_Direct_Method_Examples.m).
LGL_nodes(), LGL_Dmatrix(), LGL_weights() are mising, which can be found here