Prev: a
Next: Feature Extraction
From: Brendan Klare on 14 Mar 2010 09:53 I often will edit a matlab m file on one computer, and copy the file to a machine that is more powerful and has more resources for execution. However, I am having the following incredibly frustrating problem: many times the when I copy over an old version of an m-file with a new version, the code from the old version is run instead. I believe this has to do with the compilation of the m files, i.e. there is some intermediate code file from the old m code (.asv I think) that is being run instead of the new m code. I had been calling the 'rehash' command recently, which seemed to work better (i.e. my new code was run often than before), but I still have cases when the old code is run instead. I have also tried the refresh command with no success. Does anyone know a resolution to this problem? It is insanely frustrating to run a program that takes one hour, only to find out afterwards it ran the old version of the code.
From: John D'Errico on 14 Mar 2010 10:14 "Brendan Klare" <bklare(a)gmail.com> wrote in message <hnipnu$o7$1(a)fred.mathworks.com>... > I often will edit a matlab m file on one computer, and copy the file to a machine that is more powerful and has more resources for execution. However, I am having the following incredibly frustrating problem: many times the when I copy over an old version of an m-file with a new version, the code from the old version is run instead. I believe this has to do with the compilation of the m files, i.e. there is some intermediate code file from the old m code (.asv I think) that is being run instead of the new m code. I had been calling the 'rehash' command recently, which seemed to work better (i.e. my new code was run often than before), but I still have cases when the old code is run instead. I have also tried the refresh command with no success. > > Does anyone know a resolution to this problem? It is insanely frustrating to run a program that takes one hour, only to find out afterwards it ran the old version of the code. Where do you put these files? Do NOT place them in the MATLAB toolbox directories, as those files are not seen until MATLAB restarts. I once wrote a function to sync a set of directories, downloading only those files that are new. I should look to see where it is. John
From: Jan Simon on 14 Mar 2010 10:34 Dear Brendan! > I often will edit a matlab m file on one computer, and copy the file to a machine that is more powerful and has more resources for execution. However, I am having the following incredibly frustrating problem: many times the when I copy over an old version of an m-file with a new version, the code from the old version is run instead. I believe this has to do with the compilation of the m files, i.e. there is some intermediate code file from the old m code (.asv I think) that is being run instead of the new m code. I had been calling the 'rehash' command recently, which seemed to work better (i.e. my new code was run often than before), but I still have cases when the old code is run instead. I have also tried the refresh command with no success. > > Does anyone know a resolution to this problem? It is insanely frustrating to run a program that takes one hour, only to find out afterwards it ran the old version of the code. The .asv files are just backups of the M-files and they are not used for processing. But there are copies of the M-files in the memory. Usually they are replaced if newer versions of the files are available, but this may fail if you work on a network drive and the "change notification handles" of the operating system are exhausted. Fortunately there is a tool which never fails to remove the M-functions from the memory: CLEAR. Either clear the specific file, e.g. myFunc.m: clear myFunc or all functions: clear functions Did you try "rehash pathreset" ? I'd expected, that this works well. But I'd rely on CLEAR. Good luck, Jan
|
Pages: 1 Prev: a Next: Feature Extraction |