function Nobj=sim_catsize(Sim)
%--------------------------------------------------------------------------
% sim_catsize function                                              ImPhot
% Description: Retuen the number of sources in each SIM array catalog.
% Input  : - SIM array with catalogs.
% Output : - Vector containing the numer of objects in each SIM catalog.
% License: GNU general public license version 3
% Tested : Matlab R2015b
%     By : Eran O. Ofek                    Feb 2016
%    URL : http://weizmann.ac.il/home/eofek/matlab/
% Example: Nobj=sim_catsize(Sim);
% Reliable: 2
%--------------------------------------------------------------------------

CatField     = 'Cat';

Nsim = numel(Sim);
Nobj = zeros(Nsim,1);
for Isim=1:1:Nsim,
    Nobj(Isim) = size(Sim(Isim).(CatField),1);
end