function lineWrite(fout,label,outFormat,data)
% function lineWrite(fout,label,outFormat,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 > n),
    data = data';
end
len = length(data);

% Write lines
rows = floor(len / 200);
for i=1:rows,
    fprintf(fout,label);
    fprintf(fout,outFormat,data(1:200));
    fprintf(fout,'\n');
    data = data(201:end);
end
fprintf(fout,label);
fprintf(fout,outFormat,data);
fprintf(fout,'\n');


