Unlike a function file, a script file must not begin with the keyword function. If it does, Octave will assume that it is a function file, and that it defines a single function that should be evaluated as soon as it is defined. A script file also differs from a function file in that the variables named in a script file are not local variables, but are in the same scope as the other variables that are visible on the command line.
Even though a script file may not begin with the function keyword, it is possible to define more than one function in a single script file and load but not execute all of them at once. To do this, the first token in the file ignoring comments and other white space must be something other than function. If you have no other statements to evaluate, you can use a statement that has no effect, like this:. GNU Octave Version 3. Note: upload size limit is set to kB, after insertion of the required escape characters.
Attach Files: Comment:. Do you think this task is very important? If so, you can add your encouragement to it. This task has 0 encouragements so far. Please enter the title of George Orwell 's famous dystopian book it's a date :. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. Source Code. Join Now! Before applying your patch, using "source mfile " works for me.
Ben, does it work if you use source mfile instead of eval mfile 1:end-2? Looks like the error given by run. Do you have access to a version compiled with support for gdb? If you can compile from source I can help set up the flags for debug compilation correctly and in running gdb. I don't have a Windows machine so helping with the debug is difficult.
I'd like to understand more about how Octave is not seeing the directory. I'm trying to understand whether Octave doesn't really see the file, or if the caching mechanism for m-files is somehow filtering it out. AFAICS this is a duplicate of bug and -indeed- although the latter bug report contains too little informative to find out what is going on. The issue is that Octave doesn't seem to pick up all changes in ".
On my home network, Octave 3. Once Octave is up and running, and an m-file is added in the root of any drive network share, thumb drive, local drive , Octave will see it through "dir" or "ls" but isn't able to run it. It would be useful if someone could test whether this bug has been resolved.
I don't know if you are using Cygwin or MinGW. You will need to scroll down to discover a 3. After reviewing of the referenced bug I have determined that it is in fact the network share not the fact that it was a removable drive mapped to a virtual disk drive letter via the subst command. I am running Windows XP and the current windows distribution is 3. I am guessing that I would need to download the current version and compile it?
I will actually be happy to help do this if you are unsure that the bug has been fixed and you need it tested. Otherwise my immediate needs are met. If I knew how to update the windows distribution I would also do that.
This appears to be related to bug The 3. Can the reporter try upgrading to the 3.
0コメント