dt=0.01; iter=10000; [x y z]=lorenzo(iter,0.01); my=z; Fs=1/dt; L=length(my); NFFT = 2^nextpow2(L); % Next power of 2 from length of y Y = fft(my,NFFT)/L; f = Fs/2*linspace(0,1,NFFT/2); % Plot single-sided amplitude spectrum. st=6; plot(f(st:NFFT/4),2*abs(Y(st:NFFT/4))) title('Single-Sided Amplitude Spectrum of y(t)') xlabel('Frequency (Hz)') ylabel('|Y(f)|')