Well first of all, your y is a single number - a scalar - not a complete waveform as it should be when passed into soundsc(). Then you need to put the soundsc() outside of the loop so it plays the whole waveform, not just one number. next, your formula for the cosine wave is not right. It should be cos(2 * pi * omega * time).
Here's some more. Zoom in on the y plot so you can see it has the correct time-varying frequency.
Num=[40 42 44 40 0 40 42 44 40 0 44 45 47 0 44 45 47 0];
t = 0:1/fs:dur;
Num = interp1(0:length(Num)-1, Num, t, 'nearest');
f = zeros(length(Num),0);
y = zeros(length(Num),0);
f(i) = 440*2^(((Num(i))-49)/12);
y(i) = A*cos(2*pi*f(i)*i);
subplot(3, 1, 1);
subplot(3, 1, 2);
subplot(3, 1, 3);
Of course you could vectorize it and get rid of the for loop like this:
f = 440 * 2 .^ ((Num-49)/12);
y = A*cos(2 * pi * f .* i);
See my attached script that creates a signal and makes a wav file out of it. Adapt as needed.