function O=eobsv(A,D,i);
% EOBSV
% Compute the Extended Observability matrix O_i
% Syntax:
% O_i=eobsv(A,D,i);
% ON INPUT
% A,D  System matrices, n x n system matrix and m x n output matrix.
% I    Number of block rows.
% ON OUTPUT
% O_I  Extended Observability matrix.

% Author: David Di Ruscio

[ny,n]=size(D);
O=zeros(i*ny,n);

O(1:ny,:)=D;

w=D;
for j=2:i
    w=w*A;
    in=j*ny;  
    O(in-ny+1:in,:)=w;             
%  O((j-1)*ny+1:j*ny,:)=w;  % This is not so efficient but easier to read.
end
