function printOUT(OUT, file)

N = size(OUT,1);
M = size(OUT,2);
fid = fopen(file, 'w');

for i = 1:N
    %i
    for j = 1:M
        
        % titles
        if i == 1
            fprintf(fid, '%s\t', OUT{i,j});
            continue;
        end

        % if empty
        if isempty(OUT{i,j})
            fprintf(fid, '\t');
            continue;
        end
        
        % see if it a cell (then it is a series of string)
        if iscell(OUT{i,j})
            tmp = OUT{i,j};
            W = length(tmp);
            comb = [];
            for k = 1:W
                comb = [comb ' ' tmp{k} ];
            end
            fprintf(fid, '%s\t', comb);
        end
        
        % double
        if isnumeric(OUT{i,j})
            fprintf(fid, '%s\t', num2str(OUT{i,j})); 
        end
        
        % char
        if ischar(OUT{i,j})
            fprintf(fid, '%s\t', OUT{i,j});
        end
        
    end
    fprintf(fid, '\n');
    
end

fclose(fid);
