function co = ConObs(F,G,Hobs,Gcon) % Controllability and observability co = 1; [mh,nh] = size(Hobs); [mf,nf] = size(F); [mg,ng] = size(G); [mc,nc] = size(Gcon); if nh ~= mf 'Hobs not conformable with F' else Obs = obsv(F,Hobs); unObs = length(F) - rank(Obs) end if ng ~= mc 'Gcon not conformable with G' else Con = ctrb(F,G*Gcon); unCon = length(F) - rank(Con) end