function [RC] = ltirc(A,B) % % author: Nasser M. Abbasi % change history % ----------------------------------------------- % date reason % 3-2-92 intial % % ----------------------------------------------- % % specification: construct the controllability matrix % Rc for a time-invariant dynamic equation % % paramters: % A : is an IN argument , the nXn matrix of state quation % B : is an IN argument , the B matrix of the state equation % Rc : is an OUT parameter, the The controllabity matrix % % implicit input: % none % % implicit output : % none % %------------------------------------------------ if(nargin ~=2) error('number of input arguments must be 2, the A and B matrices'); end [row,col]= size(A); if(row ~= col) error('the matrix A supplied must be a square matrix'); end n= max(size(A)); [row,col]= size(B); % % build the first element of Rc % t(1:row,1:col)= B; cur_row= row; cur_col= col; % % Now loop from 1 to n-1 to build the rest of Rc % for i=1:n-1 a= A^i * B; [row,col]= size(a); t(1:cur_row, cur_col+1:cur_col+col)= a; cur_col= cur_col+col; end RC= t;