MATLAB: Error during FFT output argument

fft

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

Best Answer

The line
% step=1e-8; % sec
is commented out. If the leading % were removed, it would assign a numeric value to the variable named step
You then have the line
Fs =1/step; % in Hz
You have not assigned a numeric value to step, so MATLAB looks on the path and sees that there is a function named step() and assumes that you meant
Fs =1/step()
This calling of step() with no inputs is generating an error because the step() function it finds needs at least 1 input.
Related Question