spantwo(1)

NAME
spantwo - sum and intersection of subspaces

CALLING SEQUENCE
[Xp,dima,dimb,dim]=spantwo(A,B, [tol])

PARAMETERS

A, B
    : two real or complex matrices with equal number of rows

Xp  : square non-singular matrix

dima, dimb, dim
    : integers, dimension of subspaces

tol : nonnegative real number

DESCRIPTION
Given two matrices A and B with same number of rows, returns a square matrix Xp (non singular but not necessarily orthogonal) such that :

         [*,0]    (dim-dimb rows)
Xp*[A,B]=[*,*]    (dima+dimb-dim rows)
         [0,*]    (dim-dima rows)
         [0,0]
The first dima columns of inv(Xp) span range(A).

Columns dim-dimb+1 to dima of inv(Xp) span the intersection of range(A) and range(B).

The dim first columns of inv(Xp) span range(A)+range(B).

Columns dim-dimb+1 to dim of inv(Xp) span range(B).

EXAMPLE
A=[1,0,0,4;
   5,6,7,8;
   0,0,11,12;
   0,0,0,16];
B=[1,2,0,0]';C=[4,0,0,1];
Sl=ss2ss(syslin('c',A,B,C),rand(A));
[no,X]=contr(Sl(2),Sl(3));CO=X(:,1:no);  //Controllable part
[uo,Y]=unobs(Sl(2),Sl(4));UO=Y(:,1:uo);  //Unobservable part
[Xp,dimc,dimu,dim]=spantwo(CO,UO);    //Kalman decomposition
Slcan=ss2ss(Sl,inv(Xp));

SEE ALSO
spanplus, spaninter

AUTHOR
F. D.