Hi Roser, "power" is basicially magnitude squared. If you are trying to construct a power spectral density estimate, the units are in V^2/Hz.
Then it is customary to take the logarithm of that because the log is a variance stabilizing transformation for the power spectral density.
The periodogram is a nonparametric estimator of the power spectral density which you can implement using fft() as follows.
Fs = 1000;
t = 0:1/Fs:1-1/Fs;
x = cos(2*pi*100*t)+randn(size(t));
xdft = fft(x);
% only use one side because signal is real-valued
xdft = xdft(1:length(x)/2+1);
per = 1/(Fs*length(x))*abs(xdft).^2;
freq = 0:Fs/length(x):Fs/2;
plot(freq,10*log10(per))
xlabel('Hz'); ylabel('dB')
MATLAB additionally scales all the frequencies except 0 and the Nyquist by 2 in a one-sided PSD estimate, so if you want to demonstrate agreemen with:
[Pxx,F] = periodogram(x,rectwin(length(x)),length(x),Fs);
Add the line
per(2:end-1) = 2*per(2:end-1);