In order to find the frequency content of a signal in MATLAB, you can use the Discrete Fourier Transform (DFT) provided by the built-in fft
function.
Here is an example code that shows you how to calculate the frequency content of a signal:
main.m569 chars24 lines
The code above generates a 10 Hz signal and plots the signal in both time domain and frequency domain. In the frequency domain plot, you can see that the peak magnitude corresponds to the signal frequency of 10 Hz.
gistlibby LogSnag