%**************************************************************************
%This function writes to a text file Bx, By, and Bz vs z.
%
%Input:
%dat_file, data file for results
%name, probe name
%p, polynomial fit coefficients
%
%Zachary Wolf
%7/12/13

function hall2_meas_dat_calib(dat_file, name, p)

%Write the results to the data file
fid = fopen(dat_file, 'a');
fprintf(fid, '\r\n');
fprintf(fid, '%s: Calibration coefficients:  (p_1 x^n + p_2 x^n-1 + ... + p_n x + p_n+1)\r\n', name);
fprintf(fid, 'p_1 to p_n =');
for ii = 1 : length(p)
    fprintf(fid, '  %13.5e', p(ii));
end
fprintf(fid, '\r\n');
fclose(fid);

%Done
