Congratulations into the pit.
Resolve Mex-setup Command error using MEX problem
Reference
https://cn.mathworks.com/matlabcentral/answers/313298- I-already-have-mingw-on-my-computer-how-do-i-configure-it-to-work-with-matlab
First download the MINGW-W64 compiler
Download Address
Http://tdm-gcc.tdragon.net/download
One, fool installation can
creat, then keep next,
Note: 32-bit or 64-bit download needs to correspond, second, create time is recommended to check for updated files a uncheck, this is the official website advice, because the subsequent may be related to the version error.
C:\TDM-GCC-6
Second, add the system environment variables as shown
Add variable name mw_mingw64_loc, variable value is tdm-gcc-64 installation path;
third, open matlab
Enter the command, the name of the variable and the installation path, then enter Mex-setup
Setenv (' Mw_mingw64_loc ', ' C:\TDM-GCC-64 ')
Mex-setup
The result is as shown in the figure