Cntrable.m
上传用户:eighthdate
上传日期:2014-05-24
资源大小:270k
文件大小:1k
源码类别:

其他行业

开发平台:

Matlab

  1. function  S = cntrable(A,B)
  2. %  H. Saadat 1998
  3. clc
  4. % discr=[
  5. %' The  function S=cntrable(A,B) returns the transformation matrix  '
  6. %' S = [B AB A^2B . . . A^(n-1)B].  The system is completely state  '
  7. %' controllable if and only if S has a rank of n.                   '
  8. %'                                                                  '];
  9. n=length(A);
  10.   for i=1:n;
  11.   S(:,n+1-i) = A^(n-i)*B;
  12.   end
  13.   if rank(S)~=n
  14.   disp('System is not state controllable')
  15.   else
  16.   disp('System is state controllable')
  17.   end