Installation instructions for installng MinGW C/C++ compiler is given for Matlab versions R2015:
MATLAB R2015b, R2016a, R2016b, R2017a: MinGW GCC 4.9.2 from TDM
MATLAB R2017b and R2018a: MinGW GCC 5.3 from mingw-w64.org
MATLAB R2018b and beyond: MinGW GCC 6.3 from mingw-w64.org
I personally bought my R2007 and am reluctant to invest in another morre recent Matlab version. There must be an old tech note that describes the procedure for installing a C/C++ compiler.