I have a problem where Octave does not execute the newest version of recently edited scripts or functions if the working directory is a network drive. I have looked into it and it seems that Octave decides whether to reload these files based on the time stamp, and on my network for whatever reason the time stamps are very slow to update. MATLAB doesn't have this problem, nor does any other program for that matter. I'm running the MXE build of Octave for Windows 3.8.2.
Currently my only workaround is to close and re-open Octave each time I edit a file. This is obviously not convenient. I would like to set Octave to simply reload files when they are executed regardless of the dates, but I haven't found a way to do this. I'm hoping people here might have some ideas.
Returning From a Function Unlike the return statement in C, Octave's return statement cannot be used to return a value from a function. Instead, you must assign values to the list of return variables that are part of the function statement.
To stop a running command or script in octave GUI or prompt: Ctrl + C.
Simply type the filename without extension . Type run("filename. m") in the command line of Octave . Then press ctrl + c to exit the file in middle of the run .
(Seems to does not work: You can use rehash
this will Octave reinitialize its directory cache, see http://octave.sourceforge.net/octave/function/rehash.html).
You can also use clear functionName
which should clean all variables in the function and trigger a reload (you script would be called functionName.m).
I got this from the Octave mailing list: http://lists.gnu.org/archive/html/help-octave/2009-03/msg00212.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With