function [b fb] = simple2comp( a )
%
%   Simple to Composite Sample when observations 
%   are repeated
%   Input:  a - simple sample 
%   Output: b - unique values for a
%            fb - frequencies of b
%   Example:
%   a=[  4  5  6  3  4  3  5  4  6  4  3 ...
%        7  7  4  2  2  5  4  2  5  3  8];
%   [b fb] = simple2comp( a )
%  b =
%
%     2     3     4     5     6     7     8
%
% fb =
%
%     3     4     6     4     2     2     1 
b = unique(a);
for i = 1:length(b)
fb(i) = sum(ismember(a,b(i)));
end


