Some features in MATLAB require a C/C++ code compiler to function properly. However, sometimes company computers cannot install MinGW online due to various reasons (such as inability to access the internet, license expiration, etc.), necessitating an offline installation. This article will guide you through the process of offline one-click installation of MinGW.
Compatibility Between MATLAB and MinGW

Download Installation Package and One-Click Installation Script
File shared via cloud storage:MinGW.zip
Link: https://pan.baidu.com/s/1yojLmqDRjk0OTKzGDfSd7g?pwd=d1jq Extraction Code: d1jq
After downloading, copy the extracted MinGW6.3 folder to your desired installation path. Personally, I placed it in C:\Program Files.
Execute the Installation Script
Step 1:
Open MATLAB, copy the downloaded AutoInstallMinGW.p file to the MATLAB path, and then execute the following command, where the parameter in parentheses is the path to the MinGW installation package.

Step 2:
After executing the script, a prompt box will appear as shown below. Please select 【Yes】. If you have 360 antivirus software installed, please select 【Allow this operation】.


Step 3:
After installation, a prompt box will pop up.

Step 4:
Restart MATLAB, then enter mex -setup in the MATLAB command window. If the information shown below appears, it indicates that the installation is complete.

If you have any questions, please add my WeChat to leave a message for communication.
