pathdef, savepath, ocaverc and Matlab
Ben Abbott
bpabbott at mac.com
Thu Jan 3 22:19:12 CST 2008
On Jan 4, 2008, at 11:31 AM, John W. Eaton wrote:
> On 4-Jan-2008, Ben Abbott wrote:
>
> | Can you or another tell me how I can get to the list of registered
> | functions?
>
> You can't, at least not from the scripting language.
>
> | While it apprears to me that this should be done in c++, I'm not a
> c/c+
> | + programmer, and so I'm hoping to do this by adding a few lines to
> | ".../startup/octaverc".
>
> I think doing it in the scripting language makes sense.
>
> | For that to be viable, I need to have access to
> | "octave_atexit_functions".
>
> Why? Can't you just create a new function, say __finish__.m (could
> place it in the startup directory for now) like this:
>
> function __finish__ ()
> if (exist ("finish") == 2)
> ## No arg list here since finish might be a script.
> finish;
> endif
> endfunction
>
> and then add
>
> atexit ("__finish__");
>
> to the system octaverc file? Should we also allow finish to be
> implemented as a .oct or .mex file?
>
> jwe
Regarding .oct or .mex files, such it is not supported by Matlab.
----------------
When MATLAB quits, it runs a script called finish.m, if the script
exists and is on the MATLAB search path or in the current directory.
This is a file you create yourself that instructs MATLAB to perform
any final tasks just prior to terminating. For example, you might want
to save the data in your workspace to a MAT-file before MATLAB exits.
----------------
The only problem with compatibility would be if a finish.m file
follows a finish.oct/mex file in the path.
To avoid the conflict, we can use "which('finish.m')" to limit
ourselves to an m-file.
Ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.cae.wisc.edu/pipermail/octave-maintainers/attachments/20080104/027247da/attachment.html
More information about the Octave-maintainers
mailing list