function stringWrite(fout,label,data)
% function stringWrite(fout,label,data)
%
% This function writes the label followed by the data
% to a file.  The length of a line is limited to 200
% data points.  As many lines as are needed are used.
% Every line has the same label.
%

% Rearrange data
[m,n] = size(data);
if (m == 1),
    data = data';
end
len = max([m n]);

% If cells, convert to characters
if (iscell(data)),
    data = char(data);
end

% Write lines
rows = floor(len / 200);
for i=1:rows,
    fprintf(fout,label);
    for j=1:200,
        fprintf(fout,'\t%s',data(j,:));
    end   
    fprintf(fout,'\n');
    data = data(201:end,:);
end
fprintf(fout,label);
[m,n] = size(data);
for j=1:m,
    fprintf(fout,'\t%s',data(j,:));
end
fprintf(fout,'\n');
