Info
此问题已关闭。 请重新打开它进行编辑或回答。
saving data to the file
1 次查看(过去 30 天)
显示 更早的评论
How to use function fprintf in Matlab2016b? Why thoe following comands are uncorrect?
fid = fopen('file.txt','a');
fprintf(fid,'%.6f %.6f %.6f\n',xw,yw,rw);
fclose(fid);
4 个评论
回答(2 个)
Guillaume
2016-10-10
Matlab failed to open the file. There may be many reasons for this, the file does not exist / the file is not is in the current directory (since you didn't specify a path) / you don't have read access to the file / something else.
Open the file with
[fid, errmsg] = fopen('file.txt', 'a');
assert(fid > 0, 'Failed to open file because: %s', errmsg);
And see what error you get.
0 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!