MATLAB: How to make Visual Studio 2013 visible to Matlab 2018a

ccompilermexvisual studio

I have installed Visual Studio 2013 Professional under Windows 10 and I have successfully used it to write, compile, and execute a simple "Hello World" C++ program. Therefore, I think I can say with some confidence that the Visual Studio 2013 C++ compiler is available on my machine.
I would now like Matlab 2018a to be able to access this compiler through MEX, however, I obtain
>> mex -setup C++
Error using mex
No supported compiler was found. You can install the freely available MinGW-w64 C/C++ compiler; see
Install MinGW-w64 Compiler. For more options, visit https://www.mathworks.com/support/compilers.
I know this is not a matter of VS 2013 being unsupported by Matlab 2018a. The table here says it is supported. What can I do to make the Visual C++ 2013 compiler visible to mex()?

Best Answer

Well, restarting Matlab did not help, but rebooting the computer did.
Related Question