Make sure that you install the correct version of Visual Studio that is compatible with your MATLAB release:
Visual Studio Version | Supported MATLAB Version |
| R2021b Update 3 and later |
| R2019a and later |
| R2016b and later |
| R2023b and later |
| R2023b and later |
* Community, Professional, and Enterprise editions are supported. Express, Preview, and Code editions are not supported.
Reach out to your IT department or system administrator for assistance with downloading, installing, and licensing Visual Studio.
To use Visual Studio as a compiler with MATLAB/Simulink, make sure that the "Desktop development with C++" workload is selected during the installation, as shown in the screenshot below. This will make sure that the actual Visual Studio C++ (MSVC) compiler and all necessary dependencies are installed on your system.
To verify if this workload is installed for your existing installation, open Visual Studio IDE and go to Tools > Get Tools and Features, which opens the Visual Studio Installer.
Notes: