% This code is displaying the value of B but not printing in a file.
% please help me to solve this problem
write = fopen('tempresults.dat','a');

syms T

B = vpa(int(exp(-(65000.0)/(8.34*T)),273.15,573.15))

fprintf(write,'%e',B);