function co = ctrb(a,b)
%CTRB   Form the controllability matrix.
%
%   CO = CTRB(A,B)  returns the controllability matrix [B AB A^2B ...].
%
%   CO = CTRB(SYS)  returns the controllability matrix of the 
%   state-space system SYS with realization (A,B,C,D).  This is
%   equivalent to  CTRB(sys.a,sys.b)
%
%   See also  CTRBF.

%   Copyright (c) 1986-97 by The MathWorks, Inc.
%   $Revision: 1.2 $  $Date: 1997/04/09 00:34:48 $

error(nargchk(2,2,nargin))

n = size(a,1);
co = b;
for i=1:n-1,
   co = [b a*co];
end

% end ctrb
