Everything is case sensitive :
N = 1000; % size of the array
fs = 8000;
noise = randn(1,N);
Fnoise = fft(noise);
f = (0:N-1)*fs/N;
plot(f, abs(Fnoise));
For flat FFT :
N = 1000; % size of the array
M = 100; % number of FFTs to loop. Vary this value and run again to see changes in the plot.
fs = 8000;
f = (0:N-1)*fs/N; % frequency
Fnoise = zeros(1,N); % Initialize an array
for i = 1:M
noise = randn(1,N);
Fnoise = Fnoise + fft(noise);
end
Fnoise = Fnoise / M;
plot(f, abs(Fnoise));