DTMF Tone Generation in MATLAB not sounding right
You have commented the line that you assign fs. Then the time duration t should be defined with respect to fs.

It should be as follows:

fs = 8000;
t = 0:1/fs:500;