Remove audible click sound from high frequency hopped sound I have a total sound duration of $T$.

I break the duration to several sub-durations and in each sub-duration, I generate several discrete sinusoidal values by the formula $\sin(2\pi ft)$ with a sampling rate of $f_s$.

The frequency used in consecutive sub-durations is different.

Now when I generate sound using these values (using matlab) I get audible click sounds between the point where two sub-durations meet; I think because of discontinuity. How can I remove these audible click sounds? 

Edit
the code I am using (roughly)

duration = 0.25;
sampleRate = 44100;
numberOfSamples = (duration * sampleRate);
frequency = 19000:500:21500;
freqHopSamples = [];

for j = 1:length(frequency)
    startIndex = ((j-1)*(numberSubSamples) + 1);
    endIndex = j*numberSubSamples;
    t = (startIndex:endIndex)/sampleRate;
    freqHopSamples(startIndex:endIndex) = sin(2*pi*frequency(j)*t);
end

wavwrite(freqHopSamples, sampleRate, 'sound.wav');
One method is to adjust the phase of the sinusoid at the beginning of each segment to minimized the 1st or 2nd delta phase difference from the phase at the end of the last segment.  Another method might adjust several samples at each boundary to minimize multiple derivatives.

You currently seem to start with a phase of zero, which could randomize the phase delta between segments, depending on frequency and segment length.