fid = fopen('c:\\coeffs.txt','w'); //this opens the file
//now how to print 'a' to the file??
1 个答案:
答案 0 :(得分:15)
以下应该可以解决问题:
fid = fopen('c:\\coeffs.txt','wt'); % Note the 'wt' for writing in text mode
fprintf(fid,'%f\n',a); % The format string is applied to each element of a
fclose(fid);