function x = mu(n)
% Discrete-time DELTA function, unit step function
%
% Usage: x = mu(n)
%
%      n       time index vector from N_1 to N_2
%      x       sequence of zeros and ones according to
%              definition:
%                  mu(n) = 1, n>=0
%                        = 0, n<0
%
% Example: 
%  n = [-5 : 5];
%  stem(n, mu(n))   % unit step function
%
% Example: 
%  n = [-5 : 5];
%  x = mu(n) - mu(n-2)
%  stem(n, x)
%
% Example:
%  n = [-5 : 20];
%  x = 0.5.^(n-2) .* mu(n-2)  % note itemwise operations .^ .*
%  stem(n, x)
%
%
% Jukka Parviainen, 10.2.2006

x = (n >= 0);

% Can also be generated by for loops, etc.
%
%for k=1:length(n)
%  if (n(k) >= 0)
%    x(k) = 1;
%  else
%    x(k) = 0;
%  end
%end;



