fopen problem using updated software
1 次查看(过去 30 天)
显示 更早的评论
I use fopen(fid,"w") in matlab 2015b in windows, the function works well. But as I switch to matlab 2017a in mac, student use.
I have the following error:
First Input must be a file name or a file identifier.
I am wondering what's wrong?
Thanks.
b
2 个评论
Walter Roberson
2017-6-27
Please show more of your code including how you construct the variable "fid"
Note: it is quite common that the variable fid is used for a numeric file identifier returned from fopen(), rather than for the file name.
Question: are you reading the file name from a file using importdata() ?
回答(1 个)
Jan
2017-6-27
As the documentation and the error message explains, the standard calling is:
fid = fopen(FileName, 'w')
Here fid is a numerical file identifier and FileName is the string containing the name of the file.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Large Files and Big Data 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!