%
% Plot a PRBS Signal
%
%       h = plotprbs( u, dt )
%
% where   h  = plot handle
%         u  = prbs sequence
%         dt = time interval
%
% Bob Newell, February 1996
%
%--------------------------------------------------
function h = plotprbs( u, dt )
%
n = size( u );
t = 0;
d = u(1);
%
for i = 2:n,
  if u(i) == d(length(d)),
    % no need to do anything
  else,
    t = [ t (i-1)*dt (i-1)*dt ];
	d = [ d d(length(d)) u(i) ];
  end;
end;
%
h = figure;
plot( t, d )
sc = axis;
ra = sc(4) - sc(3);
axis( [ sc(1) sc(2) sc(3)-ra sc(4)+ra ] )
%
return;
%----------------------------------------------------
% the end
