"The file has been modified outside of MATLAB Editor. Do you want to reload it?" error. How to repair that?

조회 수: 23 (최근 30일)
I receive error message: "The file has been modified outside of MATLAB Editor. Do you want to reload it?" almost every time when I click somewhere outside Matlab. I receive that error message about 30 times a day. It is really annoying. In fact all my document are saved on network drive but I am only person who works on that documents. It happens for every documents of Matlab. Could you please help me resolve that issue?
  댓글 수: 1
SteveM
SteveM 2022년 10월 19일
I had exactly the same problem.
What solved it for me was to move the MATLAB code files (in my case an application in the App designer) onto a local drive. I was using Dropbox as storage before, and assume that something in the background SYNC process was upsetting Matlab. Now it works fine.

댓글을 달려면 로그인하십시오.

채택된 답변

Guillaume
Guillaume 2017년 3월 22일
There is probably an issue with your network drive where the modification timestamp on the file keeps changing, hence why matlab would think the file have changed.
If you can't fix the issue with the network drive (or use a local drive instead), then you can turn the warning off (it's not an error) by going into Preferences -> Editor/Debugger and untick Reload unedited files that have been externally modified.
  댓글 수: 6
Josh Licata
Josh Licata 2022년 11월 11일
@Marek Jarocinski old thread but I can confirm the the exact same issue with git and it is driving me crazy. I haven't found a solution yet
Marek Jarocinski
Marek Jarocinski 2022년 11월 14일
편집: Marek Jarocinski 2022년 11월 14일
@Josh Licata What solved the problem for me was to disable Matlab source control. I copy and paste from Matlab help how to do it:
------
Disable Source Control
When you disable source control, MATLAB does not destroy repository information. For example, it does not remove the .svn folder. You can put the folder back under source control by enabling the source control integration again.
  1. On the Home tab, in the Environment section, click Preferences.
  2. In the Preferences dialog box, in the MATLAB > General > Source Control pane, select None.
------

댓글을 달려면 로그인하십시오.

추가 답변 (3개)

Adam Danz
Adam Danz 2020년 8월 14일
편집: Adam Danz 2020년 8월 14일
This is a band aid, not a solution.
This is the error dialog that appears when a files stored on a mapped network drive are edited and saved - even if just 1 character was changed. It might be a different error from the one described by OP but it sounds similar.
Pressing OK then leads to this dialog box,
Press Yes. Then, from the Matlab Command Window, run
rehash path
and wait for it to complete. Then you should be able to use the m-file again.... until you make another change.
Let's hope the problem is eventually solved.
  댓글 수: 3
Adam Danz
Adam Danz 2020년 8월 14일
I saw that recommendation of yours in another thread and tried it last night but I didn't see an effect.
Just to make sure I've got the logic right, I ran "clear <filename>" after receiving this error. I'll try it again, though.
DanielFromIllinois
DanielFromIllinois 2021년 6월 29일
rehash path worked for me. I'll say that I made one more change to the file and the error appeared one last time and then it was gone.
Also for me, the error occured when running two instances of matlab and it was the second editor / window that was causing it. I had the other matlab running a process.

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2022년 11월 15일
One of the ways this can occur is if you are using a network file system, either local or something like OneDrive, and if the system time on the network system is notably different than the system time on your own system, especially if your system time is slow relative to the time at the server.
For example suppose you write a change at 14:09:17 local time on your system, but the time at the server is 14:09:22, so 14:09:22 is the time recorded at the server, while your MATLAB saved internal information that the file was modified at 14:09:17 (local time.) Then MATLAB does a periodic check to see whether the file was updated (somehow), and it sees the timestamp of 14:09:22 recorded at the server, compares that to the 14:09:17 it knew, and says "Oh, it got updated on the server!" . So you bring down the latest version, and the first modification... same thing happens, the time on the server version of the file is notably newer than the time known to MATLAB, and there goes the message again.
Because time differences even on well-run systems are a fact of life (it is surprisingly hard to synchronize clocks -- impossible according to Relativity), the MATLAB end has a built-in "grace time": if the time difference is small enough then MATLAB assumes it is due to network time differences. But if the diffrence is large enough you can get problems.
Sometimes, on some systems, rebooting the system is enough to prod the system to get a better time. But sometimes you need to synchronize your clock using a service designed to keep clocks synchronized. In Windows 10 see https://pureinfotech.com/sync-clock-windows-10/
  댓글 수: 1
Walter Roberson
Walter Roberson 2022년 11월 15일
Another way this can happen is if you are using Windows 10 and OneDrive and you have immediate synchronization turned on, then at least for some range of Windows patches, the file synchronization can fail to operate properly, resulting in a disagreement between systems about what the contents of the file are. To get around this you had to turn off immediate synchronization. (Possibly this problem has been patched by now, I do not know.)

댓글을 달려면 로그인하십시오.


Marzena Prokopiuk
Marzena Prokopiuk 2017년 3월 22일
New error message appeared. It says: The file on disk might be empty of incomplete. Ensure there is sufficient free space on your drive, and then save the file again..." - attached. I am sure I have free space on that network drive. what can I do? It is problem with network drive itself?
  댓글 수: 1
Andy Brown
Andy Brown 2019년 11월 18일
I only get this error message if I have two versions of Matlab running. I've only noticed it since I upgraded to Windows 10, but can't say for sure whether the problem existed before the upgrade.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by