if the signal is a deterministic signal, use fft to plot. If its a random signal, use this: periodogram(signal,[],'onesided',512,fs);
fs is the sampling rate.
signal is any voltage or current, expressed as a function of time.
spectrum shows the frequency components of the signal. frequency shows how fast or slowly a signal changes. If it has a frequency of 100Hz, it means it oscillates 1000 times in 1 second.
we use various techniques to find the frequency domain info of a signal.
Fourier series is used to decompose a given periodic wave into its constituent sinusoids.
Fourier transform tells about the frequency component.
there is one more transform called wavelet transform, but it won't be required if you just want to know the spectrum of a signal.