function NUC_dup = restoreNUC(NUC_uni,FR,flag_rand)

FR = max(FR,[],2);
NUC_dup = cell(sum(FR),1);
k_dup = 0;
for i = 1:size(FR,1)
    if(FR == 0)
        continue
    end
    for j = 1:FR(i)
        k_dup = k_dup+1;
        if(flag_rand)
            NUC_dup{k_dup} = NUC_uni{i};
        else
            NUC_dup{k_dup} = NUC_uni{i};
        end
    end
end

