I would like to keep my gcc 4.9 but let Matlab use gcc 4.7 because Stable Debian does not support 4.7, as observed in the thread Debian Jessie: Why gcc-4.7 conflicts with gcc-4.8? I do the following but nothing in Jessie because Matlab 2016 wants gcc 4.7.x
# https://packages.debian.org/search?keywords=gcc-4.7 apt-cache search gcc-4.7
However, I think
apt-get is not the way to go because I just want to get gcc-4.7 in my system for Matlab, not for any other purpose.
Example of the warning when using wrong gcc in Matlab
MEX completed successfully. Building with 'gcc'. Warning: You are using gcc version '4.9.2'. The version of gcc is not supported. The version currently supported with MEX is '4.7.x'. For a list of currently supported compilers see: http://www.mathworks.com/support/compilers/current_release.
OS: Debian 8.5 64 bit
Linux kernel: 4.6 of backports
Hardware: Asus Zenbook UX303UA