フィルターのクリア

"Error using feof" at exit

10 ビュー (過去 30 日間)
Marie
Marie 2016 年 5 月 10 日
編集済み: Marie 2016 年 5 月 11 日
I am running 2016a, but I had a similar problem with 2014a also. When I try to close MATLAB, I get the following errors:
*******************************************
Error using feof
Invalid file identifier. Use fopen to generate a valid file
identifier.
Error in preserve_history (line 12)
while ~feof(fid)
Error in finish (line 3)
preserve_history;
*******************************************
I did a quick google search, but did not find anything related. The only way I've been able to close the program is to force-quit through the task manager.
Any insight would be greatly appreciated.

採用された回答

Walter Roberson
Walter Roberson 2016 年 5 月 10 日
Use
which finish
to find the finish.m that is being executed. It is probably calling upon preserve_history from http://www.mathworks.com/matlabcentral/fileexchange/9291-save-entire-command-history . That code is using fopen() to open a file and is not checking to see if the open worked.
The code directly from the File Exchange uses
[fid, err] = fopen('c:\documents and settings\snelljo\application data\mathworks\matlab\r14sp3\history_saved.m', 'r');
but chances are you do not happen to have exactly that directory.
  1 件のコメント
Marie
Marie 2016 年 5 月 11 日
編集済み: Marie 2016 年 5 月 11 日
Hmm. That is interesting.
Not only do I not have the directory it is looking for, but any of the files (e.g., history_saved.m) either. Perhaps it would be best to just delete the folder and see what happens (I have a back up).
...
Deleting the history folder fixed the problem. Hopefully, I didn't create a new one by doing that, but I don't actually recall why I wanted that function. Thanks!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by