how to generate a smooth sine wave with time varying frequency in matlab I'm currently designing a knock sensor for my FSAE team's car and I'd like to be able to test various software strategies with a fairly realistic signal (at least more realistic than a couple sine waves added together with some white noise). 

From some reading, the frequencies I'll be getting will all be related to a fundamental frequency directly related to engine speed. As engine speed varies continuously, I'd like to be able to take a vector of times and transform it into a vector of frequencies that smoothly and randomly transition within the range 20-170 Hz, ideally with a uniform distribution. I can then create a couple sine waves based on these frequencies and a couple multiples, add them, add some white noise, add a knock at random points, then feed that into my knock detection code. 

It's generating a smooth, uniformly distributed frequency vector that is my current issue, but I'm also open to other solutions to the problem.
The wording of your question (your terminology) makes it difficult to understand exactly what you desire. Is your question, "Using Matlab, how do I generate a time-domain sequence representing a sinusoidal wave whose instantaneous frequency increases as a linear function of time so that its spectrum contains a broad band of spectral energy?" If so, then try the following example Matlab code:

Fs = 1000;       % Signal sample rate in Hz

Dur = 1;         % Signal's 1-second time duration

Time = 0:1/Fs:Dur;  

Fstart = 100;    % Start freq is 100 Hz

Fstop = 400;     % Final freq is 400 Hz

Sig = chirp(Time,Fstart,Dur,Fstop);   % Generate a "chirp" sequence


rpatel, generate the above 'Sig' signal, compute its DFT samples, and plot the DFT's spectral magnitude values. Maybe that's what you want.