Error during FFT output argument
Show older comments
I've recently been given a file that I've seen work, however on my computer I get an error
Output argument "yout" (and maybe others) not assigned during call to "step".
Error in read_and_FFT_1 (line 7)
Fs =1/step; % in Hz
What is causing this problem? Here's the full code:
% clear all,
% A=load('data_file.txt');
% plot(A);
% y=A;
% step=1e-8; % sec
Fs =1/step; % in Hz
L=length(y);
NFFT = 2^nextpow2(L) *2^1;
Y = fft(y,NFFT)/L;
f1 = Fs/2*linspace(0,1,NFFT/2+1); % abs RF freq.
Y1=2*abs(Y(1:NFFT/2+1)); % FFT ampl= spec. density
plot(f1,Y1,'k','LineWidth',1),
grid on, axis tight
%%%%%%%%%% zoomed plot %%%%%%%%%%%%%%
% tic
% n=[35+28e-6 35+38e-6]; % range, MHz
% n1=round(n/50 *length(f1));
% plot( f1(n1(1):n1(2)), Y1(n1(1):n1(2)) ,'k','LineWidth',2); axis tight;
% toc
Accepted Answer
More Answers (0)
Categories
Find more on Fourier Analysis and Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!