%
%  c = outcomp( G, op );
%
%  Returns the complement set of outputs described in op. All input indices
%  not in op. Example: Number of outputs is four and op=[2 3]; then c=[1 4];
% 
%  Inputs:  G  - Matrix describing the system, can bd system, constant or 
%                varying.
%           op - Set of outputs to be complemented.
%
%  Outputs: c  - complement set.
%
%  Written by: Kjetil Havre, e-mail: kjetil@ife.no
%  
%  Note: This is for sure not the most effective way to find the complemet 
%        set in matlab.
%

function c = outcomp( G, op )
   c = [];
   [mt, rd, cd, nd] = minfo(G);
   no = max(size(op));
% Added 9/8-95 KH
   if strcmp(op,':') == 1 
      return
   end
% to this spot 9/8-95.
   if no <= rd
      opc = [];
      for i=1:rd,                     
	 found = 0;
	 for j=1:no,
	    if op(j) == i;
	       found = 1;
	    end
	 end
	 if found == 0
	    opc = [opc i];
	 end
      end
      c = opc;
   else
      disp('Number of outputs is larger than rows' );
      return;
   end
end
